-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
86 lines (70 loc) · 1.43 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
.EXPORT_ALL_VARIABLES:
#Build settings
#SSL usage
USE_SSL=1
#events
USE_POLL=1
USE_EPOLL=1
#USE_KQUEUE=1
#PLATFORM=armv6l
#CC=gcc
-include Config
TOPDIR:=$(shell pwd)
ifndef CALIPSO_INC
CALIPSO_INC:=$(TOPDIR)/include
endif
ifndef CALIPSO_LIB
CALIPSO_INC:=$(TOPDIR)/libs
endif
CFLAGS+= -D_REENTRANT -D_GNU_SOURCE
#defines
ifdef USE_SSL
CFLAGS+= -DUSE_SSL
endif
ifdef USE_POLL
CFLAGS+= -DUSE_POLL
endif
ifdef USE_EPOLL
CFLAGS+= -DUSE_EPOLL
endif
ifdef USE_KQUEUE
CFLAGS+= -DUSE_KQUEUE
endif
###################################
# project related
###################################
ifndef VERSION
VERSION = $(shell cat ./VERSION)
CFLAGS+= -DVERSION="\"$(VERSION)\""
endif
ifndef PLATFORM
PLATFORM= $(shell uname -m)
endif
ifndef OS
OS = $(shell uname -s)
CFLAGS+= -DOS="\"$(OS)/$(PLATFORM)"\"
endif
all:
@make -C src
@make -C src/modules
test:
@make -C test
lines:
wc -l `find . -name *.c` | grep total
wc -l `find . -name *.h` | grep total
clean:
@make -C src clean
@make -C src/modules clean
distclean:
# @make -C src distclean
# @make -C src/modules distclean
find . -name \*~ -o -name \*.o | xargs rm -f
find . -name \*.so -o -name \*.bundle -o -name \*.orig | xargs rm -f
format:
astyle --style=stroustrup -s4 --recursive ./*.c ./*.h
install:
@make -C src install
/bin/cp ./doc/calipsoctl $(DESTDIR)/usr/bin/
/bin/mkdir -p $(DESTDIR)/etc
/bin/cp -f ./doc/calipso.conf $(DESTDIR)/etc/
/bin/cp -f ./doc/mime.types $(DESTDIR)/etc/