vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit a49046bb10f42caf06adb2c78495173e732c0c5e
parent 5daceaa9d6f3f54cfdda2e91b4779b5de88db16d
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Fri,  2 Jan 2015 23:57:54 +0100

Fix compilation on various *nix systems

Unfortunately this breaks support for BSD make.

Diffstat:
MMakefile | 2+-
Mconfig.mk | 21+++++++++++++++++++--
2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile @@ -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 diff --git 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