Skip to content

Commit

Permalink
Fix compilation on various *nix systems
Browse files Browse the repository at this point in the history
Unfortunately this breaks support for BSD make.
  • Loading branch information
martanne committed Jan 2, 2015
1 parent b55fd44 commit f22fba6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ dist: clean

install: vis
@echo stripping executable
@strip -s vis
@${STRIP} vis
@echo installing executable file to ${DESTDIR}${PREFIX}/bin
@mkdir -p ${DESTDIR}${PREFIX}/bin
@cp -f vis ${DESTDIR}${PREFIX}/bin
Expand Down
21 changes: 19 additions & 2 deletions config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit f22fba6

Please sign in to comment.