Fix the build by working around GNU Make's issues
authorAlan T. DeKok <aland@freeradius.org>
Mon, 13 Jan 2014 15:35:53 +0000 (10:35 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 13 Jan 2014 15:35:53 +0000 (10:35 -0500)
src/all.mk

index 51d4001..6a813c3 100644 (file)
@@ -1,15 +1,15 @@
 # add this dependency BEFORE including the other submakefiles.
-all: ${BUILD_DIR}/make/include/freeradius-devel src/freeradius-devel
-
-.PHONY: ${BUILD_DIR}/make/include/freeradius-devel
-${BUILD_DIR}/make/include/freeradius-devel:
-       @[ -e $@ ] || (mkdir -p $(dir $@) && ln -s ${top_builddir}/src/include $@)
-
-.PHONY: src/freeradius-devel
-src/freeradius-devel:
-       @[ -e $@ ] || (echo LN-S $@ && ln -s include $@)
-
-build/%.o build/%.lo: | src/freeradius-devel/ \
-                       ${BUILD_DIR}/make/include/freeradius-devel
+all:
+
+#
+#  This nonsense is here because pattern rules don't work if you have
+#  multiple of them.  If you try to run the shell script by assigning
+#  it to a variable, GNU Make notices that the variable isn't used...
+#  and doesn't run the shell script.  This crap below seems to bypass
+#  Make's optimization.
+#
+ifeq "$(shell [ -e src/freeradius-devel ] || ln -s include src/freeradius-devel)" ""
+       # do nothing
+endif
 
 SUBMAKEFILES := include/all.mk lib/all.mk tests/all.mk modules/all.mk main/all.mk