-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomponent.mk
74 lines (57 loc) · 2.24 KB
/
component.mk
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
64
65
66
67
68
69
70
71
72
73
74
include ../common.mk
-include generated-files.mk
.PHONY: all
ifdef COMP_C
all: ../dab-lib/lib$(COMP_C)-c.so ../dab-lib/$(COMP_C)-c.dll ../dab-lib/lib$(COMP_C)-c.dylib
else
ifdef COMP_CPP
all: ../dab-lib/lib$(COMP_CPP)-cpp.so ../dab-lib/$(COMP_CPP)-cpp.dll ../dab-lib/lib$(COMP_CPP)-cpp.dylib
endif
endif
.PHONY: clean
clean:
rm -f deps.mk
rm -f compile.log
rm -fr BUILD
rm -fr BUILD-mingw32
rm -fr BUILD-o64
rm -f ../dab-lib/lib$(COMP_C)-c.so
rm -f ../dab-lib/$(COMP_C)-c.dll
rm -f ../dab-lib/lib$(COMP_C)-c.dll.a
rm -f ../dab-lib/lib$(COMP_C)-c.dylib
rm -f ../dab-lib/lib$(COMP_CPP)-cpp.so
rm -f ../dab-lib/$(COMP_CPP)-cpp.dll
rm -f ../dab-lib/lib$(COMP_CPP)-cpp.dll.a
rm -f ../dab-lib/lib$(COMP_CPP)-cpp.dylib
ifdef COMP_C
../dab-lib/lib$(COMP_C)-c.so: $(OBJS)
@mkdir -p ../dab-lib
gcc -shared -o $@ $(OBJS)
../dab-lib/$(COMP_C)-c.dll: $(OBJSW32)
@mkdir -p ../dab-lib
i686-w64-mingw32-gcc -shared -o $@ $(OBJSW32) $(WIN_DEPS) $(DLL_DEPS) -Wl,--out-implib,../dab-lib/lib$(COMP_C)-c.dll.a
../dab-lib/lib$(COMP_C)-c.dylib: $(OBJSO64)
@mkdir -p ../dab-lib
o64-clang -dynamiclib -current_version 1.0 -compatibility_version 1.0 -o $@ $(OBJSO64) $(MAC_DEPS) $(DLL_DEPS)
DEPS_CC = gcc
DEPS_FLAGS = $(CINC)
else
ifdef COMP_CPP
../dab-lib/lib$(COMP_CPP)-cpp.so: $(OBJS)
@mkdir -p ../dab-lib
g++ -shared -o $@ $(OBJS)
../dab-lib/$(COMP_CPP)-cpp.dll: $(OBJSW32)
@mkdir -p ../dab-lib
i686-w64-mingw32-g++ -shared -o $@ $(OBJSW32) $(WIN_DEPS) $(DLL_DEPS) -Wl,--out-implib,../dab-lib/lib$(COMP_CPP)-cpp.dll.a
../dab-lib/lib$(COMP_CPP)-cpp.dylib: $(OBJSO64)
@mkdir -p ../dab-lib
o64-clang++ -dynamiclib -current_version 1.0 -compatibility_version 1.0 -o $@ $(OBJSO64) $(MAC_DEPS) $(DLL_DEPS)
DEPS_CC = g++
DEPS_FLAGS = $(CPPINC)
endif
endif
deps.mk: $(CPP_SRCS) $(CPP_SRCSGEN)
$(DEPS_CC) $(DEPS_FLAGS) -MM $(C_SRCS) $(C_SRCSGEN) $(CPP_SRCS) $(CPP_SRCSGEN) | awk '/.*\.o:/ {print "BUILD/"$$0 ; next } {print}' > $@
$(DEPS_CC) $(DEPS_FLAGS) -MM $(C_SRCS) $(C_SRCSGEN) $(CPP_SRCS) $(CPP_SRCSGEN) | awk '/.*\.o:/ {print "BUILD-mingw32/"$$0 ; next } {print}' >> $@
$(DEPS_CC) $(DEPS_FLAGS) -MM $(C_SRCS) $(C_SRCSGEN) $(CPP_SRCS) $(CPP_SRCSGEN) | awk '/.*\.o:/ {print "BUILD-o64/"$$0 ; next } {print}' >> $@
-include deps.mk