commit e9fee17c5f93ddfe217f630b241884cd998087d5
parent f2bcf7b53dda11fef711b70d1a5412194d2fdb08
Author: bsandro <email@bsandro.tech>
Date: Fri, 12 Dec 2025 23:00:45 +0200
Makefile fix
Diffstat:
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
@@ -1,13 +1,21 @@
.SUFFIXES:
MAKEFLAGS+=-rR
-CFLAGS=-std=c99 -Werror -Wall -Wextra -I.
+
+UNAME:=$(shell uname -m)
+OS=:$(shell uname -s)
+
+CFLAGS=-std=c99 -Wall -Wextra -I.
ifeq ($(DEBUG),1)
CFLAGS+=-O0 -g
else
CFLAGS+=-O3 -ffast-math
LTO=-flto
endif
-UNAME:=$(shell uname -m)
+
+ifeq ($(OS),NetBSD)
+CFLAGS+=-I/usr/pkg/include
+endif
+
ifeq ($(UNAME),riscv64)
CFLAGS+=-mtune=sifive-u74
else ifeq ($(UNAME),Power Macintosh)
@@ -20,8 +28,16 @@ endif
LDFLAGS=-lc -lm
+ifeq ($(OS),NetBSD)
+LDFLAGS+=-L/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib
+endif
+
+ifeq ($(OS),Darwin)
+LDFLAGS+=-L/opt/local/lib
+endif
+
ifeq ($(GLPK),1)
-LDFLAGS=-lglpk
+LDFLAGS+=-lglpk
endif
ifneq ($(shell which clang),)