-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
70 lines (53 loc) · 1.83 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
68
69
70
.PHONY: all clean distclean dep depend server client driver util
include Makefile.in
SRCDIR = .
LDFLAGS =
LIBS = -ldl
SRCS = BonDriverProxy.cpp BonDriverProxyEx.cpp sample.cpp
SOSRCS = BonDriver_Proxy.cpp BonDriver_Splitter.cpp
ifneq ($(UNAME), Darwin)
SOSRCS += BonDriver_LinuxPT.cpp BonDriver_DVB.cpp
endif
ifeq ($(UNAME), Darwin)
all: server serverex client sample util
else
all: server serverex client driver sample util
endif
server: BonDriverProxy
serverex: BonDriverProxyEx
client: BonDriver_Proxy.$(EXT)
driver: BonDriver_LinuxPT.$(EXT) BonDriver_DVB.$(EXT) BonDriver_Splitter.$(EXT)
BonDriverProxy: BonDriverProxy.o
$(CXX) $(CXXFLAGS) -rdynamic -o $@ $^ $(LIBS)
BonDriverProxyEx: BonDriverProxyEx.o
$(CXX) $(CXXFLAGS) -rdynamic -o $@ $^ $(LIBS)
BonDriver_Proxy.$(EXT): BonDriver_Proxy.$(EXT).o
$(CXX) $(SOFLAGS) $(CXXFLAGS) -o $@ $^ $(LIBS)
BonDriver_LinuxPT.$(EXT): BonDriver_LinuxPT.$(EXT).o
$(CXX) $(SOFLAGS) $(CXXFLAGS) -o $@ $^ $(LIBS)
BonDriver_DVB.$(EXT): BonDriver_DVB.$(EXT).o
$(CXX) $(SOFLAGS) $(CXXFLAGS) -o $@ $^ $(LIBS)
BonDriver_Splitter.$(EXT): BonDriver_Splitter.$(EXT).o
$(CXX) $(SOFLAGS) $(CXXFLAGS) -o $@ $^ $(LIBS)
sample: sample.o
$(CXX) $(CXXFLAGS) -rdynamic -o $@ $^ $(LIBS)
util:
@cd util; make
%.$(EXT).o: %.cpp .depend
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(ADDCOMPILEFLAGS) -fPIC -c -o $@ $<
%.o: %.cpp .depend
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(ADDCOMPILEFLAGS) -c -o $@ $<
clean:
$(RM) *.o *.so *.dylib BonDriverProxy BonDriverProxyEx sample .depend
$(RM) -r *.dSYM
@cd util; make clean
distclean: clean
dep: .depend
depend: .depend
ifneq ($(wildcard .depend),)
include .depend
endif
.depend:
@$(RM) .depend
@$(foreach SRC, $(SRCS:%=$(SRCDIR)/%), $(CXX) -g0 -MT $(basename $(SRC)).o -MM $(SRC) >> .depend;)
@$(foreach SRC, $(SOSRCS:%=$(SRCDIR)/%), $(CXX) -g0 -MT $(basename $(SRC)).$(EXT).o -MM $(SRC) >> .depend;)