-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
56 lines (42 loc) · 1.51 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
#############################################################################
# Makefile for building: gessctrl
#############################################################################
PREFIX = /usr/local
CC = gcc
C++ = g++
AR = ar
COMMON_DIR = ./as_common/
COMMON_LIB = $(PREFIX)/lib
LICENSE_DIR = ../extend/
TARGET_LIB = ./libMediaService.a
TARGET_DLL = ./libMediaService.so
SRC_DIR = ./
C++FLAGS += -pipe -g -w -W -Wall -fPIC -O0 -DENV_LINUX -std=c++98
ARFLAGS +=
LIBS = -shared -fPIC -lm -lpthread
INCPATH += -I./ -I$(COMMON_DIR) -I./rtmp -I./rtsp
CPPFILES += $(wildcard $(COMMON_DIR)*.cpp)
CFILES += $(wildcard $(COMMON_DIR)*.c)
HEADFILES += $(wildcard $(COMMON_DIR)*.h)
CPPFILES += $(wildcard ./rtsp/*.cpp)
CFILES += $(wildcard ./rtsp/*.c)
HEADFILES += $(wildcard ./rtsp/*.h)
CPPFILES += $(wildcard ./rtmp/*.cpp)
CFILES += $(wildcard ./rtmp/*.c)
HEADFILES += $(wildcard ./rtmp/*.h)
CPPFILES += $(wildcard ./*.cpp)
CFILES += $(wildcard ./*.c)
HEADFILES += $(wildcard ./*.h)
COBJS=$(CFILES:.c=.o)
CPPOBJS=$(CPPFILES:.cpp=.O)
all: $(TARGET_LIB) $(TARGET_DLL)
$(TARGET_DLL): $(CPPOBJS) $(COBJS)
$(C++) -o $@ $(CPPOBJS) $(COBJS) $(LIBS)
$(TARGET_LIB): $(CPPOBJS) $(COBJS)
$(AR) rcs $@ $(CPPOBJS) $(COBJS)
%.o : %.c $(HEADFILES)
$(C++) -c $(C++FLAGS) $(INCPATH) $< -o $@
%.O : %.cpp $(HEADFILES)
$(C++) -c $(C++FLAGS) $(INCPATH) $< -o $@
clean:
rm -f $(TARGET_LIB) $(TARGET_DLL) $(CPPOBJS) $(COBJS)