-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
58 lines (43 loc) · 1.55 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
include Makefile-common.inc
TARGETS = addkey oph
FAST_TARGETS = oph
addkey_DEPS = common/crp libaddkey
oph_DEPS = common/crp common/helpers common/libspeexdsp common/kiss_fft libcodecs libdesktop
oph_FAST_DEPS = common/crp common/helpers common/libspeexdsp common/kiss_fft libdesktop
addkey_LDADD =
oph_LDADD = -lm
ifdef SYSTEMROOT
oph_LDADD += -lcomctl32 -lwinmm -lws2_32
else
oph_LDADD += -lasound
endif
ifdef SYSTEMROOT
addkey_EXEADD = .exe
oph_EXEADD = .exe
endif
ifdef SYSTEMROOT
LDADD = -lm -lcomctl32 -lwinmm -lws2_32
EXEADD = .exe
else
LDADD = -lm -lasound
endif
%.target-build:
$(foreach i,$($(@:%.target-build=%)_DEPS),$(MAKE) -C $(i);)
$(CC) $(GENERIC_CFLAGS) $(foreach i,$($(@:%.target-build=%)_DEPS),$(i)/builtin.o) $($(@:%.target-build=%)_LDADD) -o $(@:%.target-build=%)$($(@:%.target-build=%)_EXEADD)
%.target-clean:
$(foreach i,$($(@:%.target-clean=%)_DEPS),$(MAKE) -C $(i) clean;)
%.target-test:
$(foreach i,$($(@:%.target-test=%)_DEPS),$(MAKE) -C $(i) test;)
all:
$(foreach i,$(TARGETS),$(MAKE) $(i).target-build;)
clean:
$(foreach i,$(TARGETS),$(MAKE) $(i).target-clean;)
$(foreach i,$(TARGETS),rm -f $(i)$($(i)_EXEADD);)
test:
$(foreach i,$(TARGETS),$(MAKE) $(i).target-test;)
%.fast-target-build:
$(foreach i,$($(@:%.fast-target-build=%)_FAST_DEPS),$(MAKE) -C $(i);)
$(CC) $(GENERIC_CFLAGS) $(foreach i,$($(@:%.fast-target-build=%)_DEPS),$(i)/builtin.o) $($(@:%.fast-target-build=%)_LDADD) -o $(@:%.fast-target-build=%)$($(@:%.fast-target-build=%)_EXEADD)
fast:
$(foreach i,$(FAST_TARGETS),$(MAKE) $(i).fast-target-build;)
.PHONY: fast