-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
67 lines (50 loc) · 1.8 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
64
65
66
67
#
# Rules for building library
#
# ----------------------------------------------------------------------------
# common rules
# ----------------------------------------------------------------------------
ROOT_PATH := ../../../..
include $(ROOT_PATH)/gcc.mk
# ----------------------------------------------------------------------------
# library and objects
# ----------------------------------------------------------------------------
LIBS := libaudio.a
LIBS_RELEASE := libaudio_release.a
DIRS_IGNORE := ./plugins/effect%
DIRS_IGNORE += ./plugins/soundtouch%
DIRS_IGNORE += ./codec%
DIRS_IGNORE += ./third-party%
AUDIO_SERVER_PATH := $(shell pwd)
INCLUDE_PATHS += -I"$(AUDIO_SERVER_PATH)/common" \
-I"$(AUDIO_SERVER_PATH)/misc" \
-I"$(AUDIO_SERVER_PATH)/player" \
-I"$(AUDIO_SERVER_PATH)/plugins/ssrc" \
-I"$(AUDIO_SERVER_PATH)/recorder"
include ./codec/codec.mk
DIRS_IGNORE += ./third-part%
DIRS_ALL := $(shell find . -type d)
DIRS := $(filter-out $(DIRS_IGNORE),$(DIRS_ALL))
SRCS := $(basename $(foreach dir,$(DIRS),$(wildcard $(dir)/*.[cS])))
OBJS := $(sort $(addsuffix .o,$(SRCS)))
# library make rules
INSTALL_PATH := $(ROOT_PATH)/lib
.PHONY: all install size clean install_clean
$(LIBS): $(LIBS_CODEC_OBJS) $(OBJS)
$(Q)$(AR) -crsD $@ $^
$(Q)$(CP) -fv $(LIBS) $(ROOT_PATH)/lib/$(LIBS_RELEASE)
$(INSTALL_PATH):
$(Q)test -d $(INSTALL_PATH) || mkdir -p $(INSTALL_PATH)
install: $(LIBS) $(INSTALL_PATH)
$(Q)$(CP) -t $(INSTALL_PATH) $<
size:
$(Q)$(SIZE) -t $(LIBS)
clean:
$(Q)-rm -f $(LIBS) $(OBJS) $(DEPS) $(LIBS_CLEAN_OBJS) $(LIBS_ALL_NAME)
install_clean:
$(Q)-rm -f $(INSTALL_PATH)/$(LIBS)
# ----------------------------------------------------------------------------
# dependent rules
# ----------------------------------------------------------------------------
DEPS = $(OBJS:.o=.d)
-include $(DEPS)