-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
67 lines (53 loc) · 1.64 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
CXX = g++
CXXFLAGS = -Wall -Wextra -pedantic -Os -I. -fPIC \
-Wno-long-long -DNDEBUG
LDFLAGS =
SH=bash
LIVE_LIB_DIR = live-media
LIVE_LIBS = -L$(LIVE_LIB_DIR)/liveMedia -lliveMedia
LIVE_LIBS += -L$(LIVE_LIB_DIR)/UsageEnvironment -lUsageEnvironment
LIVE_LIBS += -L$(LIVE_LIB_DIR)/BasicUsageEnvironment -lBasicUsageEnvironment
LIVE_LIBS += -L$(LIVE_LIB_DIR)/groupsock -lgroupsock
LIVE_INCLUDES = -I$(LIVE_LIB_DIR)/liveMedia/include
LIVE_INCLUDES += -I$(LIVE_LIB_DIR)/UsageEnvironment/include
LIVE_INCLUDES += -I$(LIVE_LIB_DIR)/BasicUsageEnvironment/include
LIVE_INCLUDES += -I$(LIVE_LIB_DIR)/groupsock/include
CXXFLAGS += $(LIVE_INCLUDES)
LDFLAGS += $(LIVE_LIBS)
# Try changing to `python2.4' if you can not build
CXXFLAGS += -I/usr/include/python2.5
LDFLAGS += -lpython2.5
SRCS = $(wildcard *.cc)
OBJS = $(SRCS:.cc=.o)
EXE = server
SHARED = _streamserver.so
all: live $(SRCS) $(EXE) $(SHARED)
RM=rm
tests: all
%.o: %.cc
$(CXX) -c -o $*.o $(CXXFLAGS) $*.cc
_streamserver.so: $(OBJS)
$(CXX) -fPIC -shared -o $@ $(OBJS) $(LDFLAGS)
$(EXE): $(OBJS)
$(CXX) -o $@ $(LDFLAGS) $(OBJS)
clean:
$(RM) $(OBJS) $(EXE) $(SHARED)
cd $(LIVE_LIB_DIR) ; make clean
bindings:
swig -c++ -python -o streamServer.cc server.i
live:
cd $(LIVE_LIB_DIR) ; make
fresh:
$(RM) web.log *.pyc cherrypy/*.pyc cherrypy/lib/*.pyc cherrypy/wsgiserver/*.pyc
tests:
@echo ======================================================================
@echo TESTS
@echo ======================================================================
@echo
@echo "Running C++ tests (no output means success)..."
@./server
@echo Done.
@echo
@echo Running Python unittests...
@python test.py
@echo