aboutsummaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-02-27 20:29:32 +0000
committerRoy Marples <roy@marples.name>2008-02-27 20:29:32 +0000
commitc2648ca5f539c450b27d35c7c0a3d41c6e193d8f (patch)
tree1de8b046bd8c1029165670c697eace4c89ece8f5 /mk
parent143570689bc93c68fa83c3eb56d622b707ec0e18 (diff)
Makefile SH variable now tweaks the default shell used by our scripts.
Diffstat (limited to 'mk')
-rw-r--r--mk/scripts.mk11
-rw-r--r--mk/sys.mk1
2 files changed, 11 insertions, 1 deletions
diff --git a/mk/scripts.mk b/mk/scripts.mk
index 9bee14d1..114d5e2b 100644
--- a/mk/scripts.mk
+++ b/mk/scripts.mk
@@ -1,14 +1,23 @@
# Install rules for our scripts
# Copyright 2007-2008 Roy Marples <roy@marples.name>
+_IN_SH= ls -1 | sed -n -e 's:\.in$$::p' | xargs
+_IN!= ${_IN_SH}
+OBJS+= ${_IN}$(shell ${_IN_SH})
+
# We store the contents of the directory for ease of use in Makefiles
-_CONTENTS_SH= ls -1 | grep -v Makefile | xargs
+_CONTENTS_SH= ls -1 | grep -v "\(Makefile\|.in$$\)" | sed -e 's:\.in$$::g' | xargs
_CONTENTS!= ${_CONTENTS_SH}
CONTENTS= ${_CONTENTS}$(shell ${_CONTENTS_SH})
include ${MK}/sys.mk
include ${MK}/os.mk
+# Tweak our shell scripts
+.SUFFIXES: .sh.in
+.sh.in.sh:
+ sed -e 's:@SHELL@:${SH}:g' -e 's:@LIB@:${LIBNAME}:g' $< > $@
+
all: ${OBJS}
realinstall: ${BIN} ${CONF} ${CONF_APPEND}
diff --git a/mk/sys.mk b/mk/sys.mk
index dc70b0a3..7be86426 100644
--- a/mk/sys.mk
+++ b/mk/sys.mk
@@ -5,6 +5,7 @@ AR?= ar
ECHO?= echo
INSTALL?= install
RANLIB?= ranlib
+SH= /bin/sh
PICFLAG?= -fPIC