aboutsummaryrefslogtreecommitdiff
path: root/config.mk
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-01-02 23:57:54 +0100
committerMarc André Tanner <mat@brain-dump.org>2015-01-03 00:07:49 +0100
commitf22fba6940e185b794ca1c6a79432d0547e5c648 (patch)
tree2164fcbe905b8235c7fad0204a0938097e0f1697 /config.mk
parentb55fd4416267295bba5f09762a94b93e37640525 (diff)
downloadvis-f22fba6940e185b794ca1c6a79432d0547e5c648.tar.gz
vis-f22fba6940e185b794ca1c6a79432d0547e5c648.tar.xz
Fix compilation on various *nix systems
Unfortunately this breaks support for BSD make.
Diffstat (limited to 'config.mk')
-rw-r--r--config.mk21
1 files changed, 19 insertions, 2 deletions
diff --git a/config.mk b/config.mk
index 06b69fa..6ba65cf 100644
--- a/config.mk
+++ b/config.mk
@@ -3,16 +3,33 @@ VERSION = devel
# Customize below to fit your system
-PREFIX = /usr/local
+PREFIX ?= /usr/local
MANPREFIX = ${PREFIX}/share/man
INCS = -I.
LIBS = -lc -lncursesw
+ifeq ($(shell uname),Darwin)
+ LIBS = -lc -lncurses
+ CFLAGS += -D_DARWIN_C_SOURCE
+else ifeq ($(shell uname),OpenBSD)
+ CFLAGS += -D_BSD_SOURCE
+else ifeq ($(shell uname),FreeBSD)
+ CFLAGS += -D_BSD_SOURCE
+else ifeq ($(shell uname),NetBSD)
+ LIBS = -lc -lcurses
+ CFLAGS += -D_BSD_SOURCE
+else ifeq ($(shell uname),SunOS)
+ INCS += -I/usr/include/ncurses
+else ifeq ($(shell uname),AIX)
+ CFLAGS += -D_ALL_SOURCE
+endif
+
CFLAGS += -std=c99 -Os ${INCS} -DVERSION=\"${VERSION}\" -DNDEBUG -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700
LDFLAGS += ${LIBS}
DEBUG_CFLAGS = ${CFLAGS} -UNDEBUG -O0 -g -ggdb -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter
-CC = cc
+CC ?= cc
+STRIP ?= strip