-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathMakefile
56 lines (46 loc) · 1.91 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
# Set HAVE_WOLFSSL or HAVE_MBEDTLS variable if you want to use WOLFSSL or
# MBEDTLS instead of LIBTOMCRYPT
OBJECTS_O = onvif_simple_server.o device_service.o media_service.o media2_service.o ptz_service.o events_service.o deviceio_service.o fault.o conf.o utils.o log.o ezxml_wrapper.o ezxml/ezxml.o
OBJECTS_N = onvif_notify_server.o conf.o utils.o log.o ezxml_wrapper.o ezxml/ezxml.o
OBJECTS_W = wsd_simple_server.o utils.o log.o ezxml_wrapper.o ezxml/ezxml.o
ifdef HAVE_WOLFSSL
INCLUDE = -DHAVE_WOLFSSL -Iextras/wolfssl -ffunction-sections -fdata-sections -lrt
LIBS_O = -Wl,--gc-sections extras/wolfssl/src/.libs/libwolfssl.a -lpthread -lrt
LIBS_N = -Wl,--gc-sections extras/wolfssl/src/.libs/libwolfssl.a -lpthread -lrt
else
ifdef HAVE_MBEDTLS
INCLUDE = -DHAVE_MBEDTLS -Iextras/mbedtls/include -ffunction-sections -fdata-sections -lrt
LIBS_O = -Wl,--gc-sections extras/mbedtls/library/libmbedcrypto.a -lpthread -lrt
LIBS_N = -Wl,--gc-sections extras/mbedtls/library/libmbedcrypto.a -lpthread -lrt
else
INCLUDE = -Iextras/libtomcrypt/src/headers -ffunction-sections -fdata-sections -lrt
LIBS_O = -Wl,--gc-sections extras/libtomcrypt/libtomcrypt.a -lpthread -lrt
LIBS_N = -Wl,--gc-sections extras/libtomcrypt/libtomcrypt.a -lpthread -lrt
endif
endif
LIBS_W = -Wl,--gc-sections
ifeq ($(STRIP), )
STRIP=echo
endif
all: onvif_simple_server onvif_notify_server wsd_simple_server
log.o: log.c $(HEADERS)
$(CC) -c $< -std=c99 -fPIC -Os $(INCLUDE) -o $@
%.o: %.c $(HEADERS)
$(CC) -c $< -fPIC -Os $(INCLUDE) -o $@
onvif_simple_server: $(OBJECTS_O)
$(CC) $(OBJECTS_O) $(LIBS_O) -fPIC -Os -o $@
$(STRIP) $@
onvif_notify_server: $(OBJECTS_N)
$(CC) $(OBJECTS_N) $(LIBS_N) -fPIC -Os -o $@
$(STRIP) $@
wsd_simple_server: $(OBJECTS_W)
$(CC) $(OBJECTS_W) $(LIBS_W) -fPIC -Os -o $@
$(STRIP) $@
.PHONY: clean
clean:
rm -f onvif_simple_server
rm -f onvif_notify_server
rm -f wsd_simple_server
rm -f $(OBJECTS_O)
rm -f $(OBJECTS_N)
rm -f $(OBJECTS_W)