[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
new build system
From: |
Jason Zaugg |
Subject: |
new build system |
Date: |
Thu, 20 Sep 2001 16:15:56 +1000 |
Matt,
When I tried to 'make clean' from within a subdirectory
($CS_COMMON_DE/tools/property), gnu make dumped core. There is a bug in the
builtin 'if' function when trailing characters suffix the $(if cond,a,b)
construct. A test to reproduce the behaviour follows.
I've worked around it as follows:
@@ -36,12 +41,13 @@
#
define run-target-clean
echo "cleaning `pwd` ... \c"
-find $(if $(1),$(1),.) \( -name ir.out -o -name core \
+DIR=$(1); \
+find $${DIR:-.} \( -name ir.out -o -name core \
-o -name 'version.cc' \
-o -name '*.o' \
-o -name '*~' \) \
- -type f -exec rm -f {} \;
-find $(if $(1),$(1),.) -name $(CS_BUILD_CONFIG) -type d -exec rm -rf {} \;
+ -type f -exec rm -f {} \; ;\
+find $${DIR:=.} -name $(CS_BUILD_CONFIG) -type d -exec rm -rf {} \;
echo "done\n"
endef
... but there's probably a cleaner way.
Adios,
Jason
test.mk
-------
SHELL=/bin/ksh
dump_core:
echo $(if ,true,false).
retain_core:
echo $(if ,true,false)
echo $(if 1,true,false)
echo $(if 1,true,false).
-------
address@hidden /tmp]$ make -f test.mk retain_core
echo false
false
echo true
true
address@hidden /tmp]$ make -f test.mk dump_core
Segmentation Fault (core dumped)
address@hidden /tmp]$ alias make
alias make='/usr/local/gnu/bin/make'
address@hidden /tmp]$ make -v
GNU Make version 3.78.1, by Richard Stallman and Roland McGrath.
Built for sparc-sun-solaris2.6
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Report bugs to <address@hidden>.
address@hidden /tmp]$
- new build system,
Jason Zaugg <=