-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
41 lines (28 loc) · 938 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
TARGET_DUMP=regfdump
OBJ_DUMP=regfdump.o rbtree.o oobmsg.o regf_cmn.o
TARGET_WALK=regfwalk
OBJ_WALK=regfwalk.o rbtree.o oobmsg.o regf_cmn.o
TARGET_TREE=regftree
OBJ_TREE=regftree.o rbtree.o oobmsg.o regf_cmn.o
CFLAGS += -Wall -g
UNAME_S=$(shell uname -s)
ifeq ($(UNAME_S),FreeBSD)
CFLAGS +=-I/usr/local/include
LDFLAGS +=-L/usr/local/lib -liconv
endif
PREFIX?=/usr/local
.PHONY: all install clean
all: $(TARGET_DUMP) $(TARGET_WALK) $(TARGET_TREE)
$(TARGET_DUMP): $(OBJ_DUMP)
$(TARGET_WALK): $(OBJ_WALK)
$(TARGET_TREE): $(OBJ_TREE)
install: all
test -n "$(PREFIX)" && (test -d "$(PREFIX)" || mkdir -p "$(PREFIX)")
test -d "$(PREFIX)/bin" || mkdir -p "$(PREFIX)/bin"
install -m 0755 $(TARGET_DUMP) "$(PREFIX)/bin"
install -m 0755 $(TARGET_WALK) "$(PREFIX)/bin"
install -m 0755 $(TARGET_TREE) "$(PREFIX)/bin"
clean:
rm -rf $(TARGET_DUMP) $(OBJ_DUMP)
rm -rf $(TARGET_WALK) $(OBJ_WALK)
rm -rf $(TARGET_TREE) $(OBJ_TREE)