-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·105 lines (76 loc) · 3.09 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# This makefile generated by Armando Baños Pascual
# Dependencies
#
# libcrypt, libglib-2.0, libwebsockets
# variables
OBJECTS = splashd.o conf.o util.o linux.o gateway.o firewall.o http.o websck.o passive.o tls.o
INCLUDES = -I. -I/usr/include `pkg-config --cflags glib-2.0 gio-unix-2.0`
WARNINGS = -Wall
LIBRARYPATH = -L/usr/lib -L/lib
LIBRARIES = -lcrypt -lwebsockets `pkg-config --libs glib-2.0 gio-unix-2.0` -lnetfilter_queue -lssl
CC = g++
#LD = nccld
#CC = nccgen -ncgcc=g++ -ncld -ncfabs
EXECUTABLE = sicatd
CONFFILE = sicat.conf
DEBUG_YES = -g
DEBUG_NO =
#DEBUG = $(DEBUG_YES)
DEBUG = $(DEBUG_NO)
OPTIMIZATIONS_0 =
OPTIMIZATIONS_1 = -O1
OPTIMIZATIONS_2 = -O2
OPTIMIZATIONS_3 = -O3
#optimization for size
OPTIMIZATIONS_s = -Os
OPTIMIZATIONS = $(OPTIMIZATIONS_s)
OUTPUT = -o $(EXECUTABLE)
# Rules
sicatd : $(OBJECTS)
$(CC) $(INCLUDES) $(WARNINGS) $(OPTIMIZATIONS) $(DEBUG) $(OUTPUT) $(OBJECTS) $(LIBRARYPATH) $(LIBRARIES)
splashd.o : splashd.cc splashd.h gateway.h
$(CC) -c $(INCLUDES) $(WARNINGS) $(OPTIMIZATIONS) $(DEBUG) splashd.cc
conf.o : conf.cc conf.h util.cc util.h config.h linux.h http.h firewall.h defaults.h
$(CC) -c $(INCLUDES) $(WARNINGS) $(OPTIMIZATIONS) $(DEBUG) conf.cc
util.o : util.cc util.h config.h
$(CC) -c $(INCLUDES) $(WARNINGS) $(OPTIMIZATIONS) $(DEBUG) util.cc
linux.o : linux.cc linux.h http.h firewall.h util.h
$(CC) -c $(INCLUDES) $(WARNINGS) $(OPTIMIZATIONS) $(DEBUG) linux.cc
gateway.o : gateway.cc gateway.h http.h http.cc conf.h conf.cc util.cc util.h firewall.cc firewall.h
$(CC) -c $(INCLUDES) $(WARNINGS) $(OPTIMIZATIONS) $(DEBUG) gateway.cc
firewall.o : firewall.cc firewall.h
$(CC) -c $(INCLUDES) $(WARNINGS) $(OPTIMIZATIONS) $(DEBUG) firewall.cc
http.o : http.cc http.h util.cc util.h mime.h
$(CC) -c $(INCLUDES) $(WARNINGS) $(OPTIMIZATIONS) $(DEBUG) http.cc
websck.o : websck.h websck.cc gateway.h config.h
# $(CC) -c $(INCLUDES) $(WARNINGS) $(OPTIMIZATIONS) $(DEBUG) -Wno-pmf-conversions websck.cc
$(CC) -c $(INCLUDES) $(WARNINGS) $(OPTIMIZATIONS) $(DEBUG) websck.cc
passive.o : gateway.h passive.cc firewall.cc firewall.h conf.h util.h
$(CC) -c $(INCLUDES) $(WARNINGS) $(OPTIMIZATIONS) $(DEBUG) passive.cc
tls.o : tls/tls.c tls/tls.h
$(CC) -c $(INCLUDES) $(WARNINGS) $(OPTIMIZATIONS) $(DEBUG) tls/tls.c
csicatd : csicatd.o
$(CC) $(INCLUDES) $(WARNINGS) $(OPTIMIZATIONS) $(DEBUG) -o csicatd csicatd.o $(LIBRARYPATH) `pkg-config --libs glib-2.0 gio-unix-2.0`
csicatd.o : csicatd.cc csicatd.h
$(CC) -c $(INCLUDES) $(WARNINGS) $(OPTIMIZATIONS) $(DEBUG) csicatd.cc
.PHONY: clean clean-all install test
clean :
-rm -f $(EXECUTABLE) $(OBJECTS)
clean-all:
-rm -f $(EXECUTABLE) $(OBJECTS)
-rm -f /usr/sbin/$(EXECUTABLE)
-rm -f /usr/libexec/sicat/*
-rm -f /etc/$(CONFFILE)
-rm -f /usr/share/sicat/htdocs/splash.html
-rm -f /usr/share/sicat/htdocs/images/*
install :
-cp -rf $(EXECUTABLE) /usr/sbin/$(EXECUTABLE)
-cp -rf iptables/* /usr/libexec/sicat
-cp -rf $(CONFFILE) /etc/$(CONFFILE)
-cp -rf htdocs/splash.html /usr/share/sicat/htdocs
-cp -rf htdocs/images/* /usr/share/sicat/htdocs/images
test :
make clean-all
make
make install
/usr/sbin/$(EXECUTABLE)