aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-11-18 19:39:48 +0100
committerMattias Andrée <maandree@operamail.com>2013-11-18 19:39:48 +0100
commit9fab3e050f7b4e1816a966e7ce74fce74b991709 (patch)
treea79ac5242fffe3330df0ce8846bfe6cddff878b3 /Makefile
parentsome login actions (diff)
downloadlibpassphrase-9fab3e050f7b4e1816a966e7ce74fce74b991709.tar.gz
libpassphrase-9fab3e050f7b4e1816a966e7ce74fce74b991709.tar.bz2
libpassphrase-9fab3e050f7b4e1816a966e7ce74fce74b991709.tar.xz
more flexible
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile23
1 files changed, 22 insertions, 1 deletions
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