summaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authorDave Hibberd <hibby@debian.org>2025-07-22 20:56:59 +0100
committerDave Hibberd <hibby@debian.org>2025-07-22 20:56:59 +0100
commit1f40ff4a07793ecfa679a1384053451c4f3f536f (patch)
treec0813999c7216f98b4ac66224bd01589baee84d1 /makefile
parentb128f2a43a16acef50de045ae6526772c04c395e (diff)
New upstream version 6.0.24.77+repackupstream/6.0.24.77+repack
Diffstat (limited to 'makefile')
-rw-r--r--makefile36
1 files changed, 29 insertions, 7 deletions
diff --git a/makefile b/makefile
index 7f870ff..cdb6298 100644
--- a/makefile
+++ b/makefile
@@ -17,22 +17,44 @@ OBJS = pngwtran.o pngrtran.o pngset.o pngrio.o pngwio.o pngtrans.o pngrutil.o pn
# Configuration:
-CC = gcc
-
-all: CFLAGS = -DLINBPQ -MMD -g -rdynamic -fcommon
-all: LDFLAGS = -l:libpaho-mqtt3a.a -l:libjansson.a
+#Default to Linux
+ CC = gcc
+ EXTRA_LDFLAGS = -Xlinker -Map=output.map -lrt -l:libpaho-mqtt3a.a -l:libjansson.a
+
+#other OS
+
+OS_NAME = $(shell uname -s)
+ifeq ($(OS_NAME),NetBSD)
+ CC = cc
+ EXTRA_CFLAGS = -DFREEBSD -DNOMQTT -I/usr/pkg/include
+ EXTRA_LDFLAGS = -Xlinker -Map=output.map -Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lrt -lutil -lexecinfo
+endif
+ifeq ($(OS_NAME),FreeBSD)
+ CC = cc
+ EXTRA_CFLAGS = -DFREEBSD -DNOMQTT -I/usr/local/include
+ EXTRA_LDFLAGS = -Xlinker -Map=output.map -L/usr/local/lib -lrt -liconv -lutil -lexecinfo
+endif
+ifeq ($(OS_NAME),Darwin)
+ CC = gcc
+ EXTRA_CFLAGS = -DMACBPQ -DNOMQTT
+ EXTRA_LDFLAGS = -liconv
+endif
+
+$(info OS_NAME is $(OS_NAME))
+
+all: CFLAGS = -DLINBPQ -MMD -g -fcommon -fasynchronous-unwind-tables $(EXTRA_CFLAGS)
all: linbpq
-nomqtt: CFLAGS = -DLINBPQ -MMD -fcommon -g -rdynamic -DNOMQTT
+nomqtt: CFLAGS = -DLINBPQ -MMD -fcommon -g -rdynamic -DNOMQTT -fasynchronous-unwind-tables
nomqtt: linbpq
-noi2c: CFLAGS = -DLINBPQ -MMD -DNOI2C -g -rdynamic -fcommon
+noi2c: CFLAGS = -DLINBPQ -MMD -DNOI2C -g -rdynamic -fcommon -fasynchronous-unwind-tables
noi2c: linbpq
linbpq: $(OBJS)
- gcc $(OBJS) -Xlinker -Map=output.map -l:libminiupnpc.a -lrt -lm -lz $(LDFLAGS) -lpthread -lconfig -lpcap -o linbpq
+ cc $(OBJS) $(EXTRA_LDFLAGS) -lminiupnpc -lm -lz $(LDFLAGS) -lpthread -lconfig -lpcap -o linbpq
sudo setcap "CAP_NET_ADMIN=ep CAP_NET_RAW=ep CAP_NET_BIND_SERVICE=ep" linbpq
-include *.d