summaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authorDave Hibberd <hibby@debian.org>2025-07-22 20:57:03 +0100
committerDave Hibberd <hibby@debian.org>2025-07-22 20:57:03 +0100
commit1cc87cf7663179e46d40e316276f2604bc8a7872 (patch)
tree3f2080524be7d2b41616b758bd65d4745a055e79 /makefile
parent30b1e26a04be2474ebda4cac931831dabb89eb74 (diff)
parent1f40ff4a07793ecfa679a1384053451c4f3f536f (diff)
Update upstream source from tag 'upstream/6.0.24.77+repack'
Update to upstream version '6.0.24.77+repack' with Debian dir bbbd57413e9e0c750630f2d175419335251e159d
Diffstat (limited to 'makefile')
-rw-r--r--makefile32
1 files changed, 27 insertions, 5 deletions
diff --git a/makefile b/makefile
index 6d7c6e4..cdb6298 100644
--- a/makefile
+++ b/makefile
@@ -17,10 +17,32 @@ 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 -fasynchronous-unwind-tables
-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
@@ -32,7 +54,7 @@ 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