commit 83e5716fc8202e76936b4e655a7905de40133ccc
parent 675f1170266f7659530c495fbbe1f1cc6445b405
Author: Kris Maglione <kris@suckless.org>
Date: Sun, 29 Aug 2010 08:53:15 -0400
Fix build on gmake 3.82. Closes issue #216.
Diffstat:
3 files changed, 14 insertions(+), 22 deletions(-)
diff --git a/mk/hdr.mk b/mk/hdr.mk
@@ -22,11 +22,6 @@ FILTER = cat
EXCFLAGS = $(INCLUDES) -D_XOPEN_SOURCE=600
-# Try to avoid bash if possible. It slows the build considerably.
-SHELL := $(shell which /bin/dash 2>/dev/null || echo /bin/sh)
-SHELL != which /bin/dash 2>/dev/null || echo /bin/sh
-.SHELL: name=sh path=$(SHELL)
-
COMPILE_FLAGS = $(EXCFLAGS) $(CFLAGS)
COMPILE = $(SHELL) $(ROOT)/util/compile "$(CC)" "$(PACKAGES)" "$(COMPILE_FLAGS)"
COMPILEPIC = $(SHELL) $(ROOT)/util/compile "$(CC)" "$(PACKAGES)" "$(COMPILE_FLAGS) $(SOCFLAGS)"
@@ -43,28 +38,24 @@ CTAGS=ctags
PACKAGES =
-# and this:
# Try to find a sane shell. /bin/sh is a last resort, because it's
# usually bash on Linux, which means it's painfully slow.
-BINSH := $(shell \
- if [ -x /bin/dash ]; then echo /bin/dash; \
- elif [ -x /bin/ksh ]; then echo /bin/ksh; \
- else echo /bin/sh; fi)
-BINSH != echo /bin/sh
+SHELLSEARCH = for sh in /bin/dash /bin/ksh /bin/sh; do \
+ if test -x $$sh; then echo $$sh; exit; fi; done
-include $(ROOT)/config.mk
+BINSH:= $(shell $(SHELLSEARCH))
+BINSH!= $(SHELLSEARCH)
+SHELL := $(BINSH)
+.SHELL: name=sh path=$(SHELL)
-# I hate this.
-MKCFGSH=if test -f $(ROOT)/config.local.mk; then echo $(ROOT)/config.local.mk; else echo /dev/null; fi
-MKCFG:=$(shell $(MKCFGSH))
-MKCFG!=$(MKCFGSH)
-include $(MKCFG)
+include $(ROOT)/config.mk
+sinclude $(ROOT)/config.local.mk
+sinclude $(shell echo .)depend
.SILENT:
.SUFFIXES: .$(SOEXT) .1 .3 .awk .build .c .clean .depend .install .man1 .man3 .o .o_pic .out .pdf .py .rc .sh .uninstall
all:
-MAKEFILES=.depend
.c.depend:
echo MKDEP $<
$(DEBUG) eval "$(MKDEP) $(COMPILE_FLAGS)" $< | sed '1s|.*:|$(<:%.c=%.o):|' >>.depend
diff --git a/mk/man.mk b/mk/man.mk
@@ -1,7 +1,7 @@
targ = for k in $(MANPAGES); do echo $$k | sed 's/ .*//'; done
-TARG := $(shell $(targ))
-TARG != $(targ)
+TARG:= $(shell $(targ))
+TARG!= $(targ)
all: $(TARG)
install: $(TARG:.1=.install) $(TARG:.3=.install) maninstall
diff --git a/mk/wmii.mk b/mk/wmii.mk
@@ -4,8 +4,9 @@ VERS = $$(test -n "$$WMII_HGVERSION" && echo $$WMII_HGVERSION || \
echo -n "hg$$(hg id -n 2>/dev/null)")
WMII_HGVERSION = $(VERS)
-WMII_HGVERSION := $(shell echo $(VERS))
-WMII_HGVERSION != echo $(VERS)
+WMII_HGVERSION:= $(shell echo $(VERS))
+WMII_HGVERSION!= echo $(VERS)
+
VERSION = $(WMII_HGVERSION)
COPYRIGHT = ©2010 Kris Maglione