From 9fab3e050f7b4e1816a966e7ce74fce74b991709 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 18 Nov 2013 19:39:48 +0100 Subject: more flexible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 79fb87f..1c64f75 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,26 @@ +BIN = /bin +DEV = /dev + +EXTRA_CPP_FLAGS = +# -DOWN_VCS -DOWN_VCSA -DUSE_TTY_GROUP + +TTY_GROUP = tty +DEFAULT_HOME = / +DEFAULT_SHELL = $(BIN)/sh +DEFAULT_TERM = dumb +VCS = $(DEV)/vcs +VCSA = $(DEV)/vcsa + +H = \# +VCS_LEN = $(shell vcs="$(VCS)" ; echo "$${$(H)vcs}") +VCSA_LEN = $(shell vcsa="$(VCSA)" ; echo "$${$(H)vcsa}") +VCS_VCSA_LEN = $(shell (echo $(VCS_LEN) ; echo $(VCSA_LEN)) | sort -n | tail -n 1) + +STR_DEFS = TTY_GROUP DEFAULT_HOME DEFAULT_SHELL DEFAULT_TERM +INT_DEFS = VCS_LEN VCSA_LEN VCS_VCSA_LEN + OPTIMISE = -Os -CPPFLAGS = +CPPFLAGS = $(EXTRA_CPP_FLAGS) $(foreach D, $(INT_DEFS), -D'$(D)=$($(D))') $(foreach D, $(STR_DEFS), -D'$(D)="$($(D))"') LDFLAGS = CFLAGS = -std=gnu99 -Wall -Wextra -- cgit v1.2.3-70-g09d2