-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
executable file
·65 lines (45 loc) · 1.02 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
include Makefile.inc
##
# Library
##
CC_FLAGS := $(INCLUDE) $(CC_FLAGS)
SRC_C := $(wildcard src/*.c)
OBJ_C := $(SRC_C:.c=.o)
LD_FLAGS := -shared
TOBJ := $(OBJ_C) $(OBJ_CU)
OBJDIR := obj
SRCDIR := src
OBJ := $(subst $(SRCDIR), $(OBJDIR), $(TOBJ))
LIB := libnvcd.so
$(LIB): $(OBJ)
$(CC) $(CC_FLAGS) $(LD_FLAGS) $(OBJ) $(LIBS) -o bin/$(LIB)
$(LIB).pre: $(PRE)
obj/%.o: src/%.c objdep
$(CC) $(CC_FLAGS) -c $< -o $@
include $(NVCD_HOME)/nvcdrun/Makefile
include $(NVCD_HOME)/nvcdinfo/Makefile
include $(NVCD_HOME)/hook/Makefile
all: $(HOOK_LIB) $(UTIL_BIN) $(TEST_BIN)
# Housekeeping
objdep:
mkdir -p obj
mkdir -p nvcdrun/obj
mkdir -p nvcdinfo/obj
mkdir -p hook/obj
mkdir -p bin
clean:
rm -f bin/*
rm -f obj/*.o
rm -f *~
rm -f include/*~
rm -f src/*~
rm -f nvcdrun/src/*~
rm -f nvcdinfo/src/*~
rm -f nvcdrun/include/*~
rm -f nvcdinfo/include/*~
rm -rf nvcdrun/obj
rm -rf nvcdinfo/obj
rm -rf hook/obj
rm -rf $(UTIL_GROUP_INFO_DIRECTORY)
compile: $(HOOK_LIB) $(TEST_BIN) $(UTIL_BIN)
recompile: clean compile