summaryrefslogtreecommitdiff
path: root/debian/patches/makefile
blob: f042fd903e35e33c6903f2e73f886c09d3e3b855 (plain)
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
--- a/makefile
+++ b/makefile
@@ -18,9 +18,12 @@
 # Configuration:
 
 CC = gcc
-		                       
-all: CFLAGS = -DLINBPQ -MMD -g -fcommon
-all: LDFLAGS = -l:libpaho-mqtt3a.a -l:libjansson.a
+CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
+CFLAGS+=$(shell dpkg-buildflags --get CPPFLAGS)
+LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
+
+all: CFLAGS += -DLINBPQ -MMD -g -fcommon
+all: LIBS = -lpaho-mqtt3a -ljansson -lminiupnpc -lrt -lm -lz -lpthread -lconfig -lpcap 
 all: linbpq
 
 
@@ -32,12 +35,15 @@
 
 
 linbpq: $(OBJS)
-	gcc $(OBJS) -Xlinker -Map=output.map -l:libminiupnpc.a -lrt -lm -lz $(LDFLAGS) -lpthread -lconfig -lpcap -o linbpq
-	sudo setcap "CAP_NET_ADMIN=ep CAP_NET_RAW=ep CAP_NET_BIND_SERVICE=ep" linbpq		
+	gcc $(OBJS) $(CLFAGS) $(LDFLAGS) $(LIBS) -o linbpq
+	# sudo setcap "CAP_NET_ADMIN=ep CAP_NET_RAW=ep CAP_NET_BIND_SERVICE=ep" linbpq
 
 -include *.d
 
-clean :
-	rm *.d
-	rm linbpq $(OBJS)
-
+install:
+	install -b -m 755  -D -d		debian/linbpq/usr/sbin
+	install -b -m 755  -p linbpq		debian/linbpq/usr/sbin
+
+clean:
+	$(RM) *.d
+	$(RM) linbpq $(OBJS)