linbpq/debian/patches/makefile

61 lines
1.7 KiB
Makefile
Raw Normal View History

2023-07-18 01:26:17 +01:00
--- a/makefile
+++ b/makefile
@@ -2,7 +2,7 @@
2024-11-05 21:46:27 +00:00
# To exclude i2c support run make noi2c
-OBJS = pngwtran.o pngrtran.o pngset.o pngrio.o pngwio.o pngtrans.o pngrutil.o pngwutil.o\
+COMPLETE_SRC = pngwtran.o pngrtran.o pngset.o pngrio.o pngwio.o pngtrans.o pngrutil.o pngwutil.o\
pngread.o pngwrite.o png.o pngerror.o pngget.o pngmem.o APRSIconData.o AISCommon.o\
upnp.o APRSStdPages.o HSMODEM.o WinRPR.o KISSHF.o TNCEmulators.o bpqhdlc.o SerialPort.o\
adif.o WebMail.o utf8Routines.o VARA.o LzFind.o Alloc.o LzmaDec.o LzmaEnc.o LzmaLib.o \
2024-11-29 11:37:37 +00:00
@@ -18,26 +18,34 @@
# Configuration:
CC = gcc
-
-all: CFLAGS = -DLINBPQ -MMD -g -fcommon
-all: LDFLAGS = -l:libpaho-mqtt3a.a -l:libjansson.a
-all: linbpq
+LD = $(CC)
+CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
+CFLAGS+=$(shell dpkg-buildflags --get CPPFLAGS)
+CFLAGS+=-DLINBPQ
2024-11-29 11:37:37 +00:00
+LDFLAGS:=
+
+$(warning CFLAGS are $(CFLAGS))
2024-11-29 11:37:37 +00:00
+$(warning LDLAGS are $(LDFLAGS))
+
+LIBS = -lrt -lm -lz -lpthread -lconfig -lpcap -lpaho-mqtt3a -ljansson -lminiupnpc
2024-11-29 11:37:37 +00:00
+all: linbpq
-nomqtt: CFLAGS = -DLINBPQ -MMD -fcommon -g -DNOMQTT
+nomqtt: CFLAGS += -DNOMQTT
nomqtt: linbpq
-noi2c: CFLAGS = -DLINBPQ -MMD -DNOI2C -g -fcommon
+noi2c: CFLAGS += -DNOI2C
noi2c: linbpq
2024-11-29 11:37:37 +00:00
-
-linbpq: $(OBJS)
- gcc $(OBJS) -Xlinker -Map=output.map -l:libminiupnpc.a -lrt -lm -lz $(LDFLAGS) -lpthread -lconfig -lpcap -o linbpq
2023-07-18 01:26:17 +01:00
- sudo setcap "CAP_NET_ADMIN=ep CAP_NET_RAW=ep CAP_NET_BIND_SERVICE=ep" linbpq
2024-11-29 11:37:37 +00:00
+linbpq: $(COMPLETE_SRC)
+ $(GCC) $(COMPLETE_SRC) $(CFLAGS) $(LDFLAGS) $(LIBS) -o linbpq
2023-07-18 01:26:17 +01:00
2024-11-29 11:37:37 +00:00
-include *.d
2023-07-18 01:26:17 +01:00
2024-11-05 21:46:27 +00:00
-clean :
2023-07-18 01:26:17 +01:00
- rm *.d
- rm linbpq $(OBJS)
2024-11-29 11:37:37 +00:00
-
2024-11-05 21:46:27 +00:00
+install:
+ install -b -m 755 -D -d debian/linbpq/usr/sbin
+ install -b -m 755 -p linbpq debian/linbpq/usr/sbin
+
2024-11-05 21:46:27 +00:00
+clean:
2024-03-26 20:24:27 +00:00
+ $(RM) *.d
+ $(RM) linbpq $(OBJS)