Description of Problem: I am using CDL to build the list of test programs. This can result in trailing space in the TESTS line in the Makefile. This then causes a problem when building the tests. It tries to cat .d which does not exist. A simple fix... Index: pkgconf/rules.mak =================================================================== RCS file: /data/cvs/plc1g/sa1110/ecos/packages/pkgconf/rules.mak,v retrieving revision 1.1.1.1 diff -u -c -r1.1.1.1 rules.mak cvs diff: conflicting specifications of output style *** pkgconf/rules.mak 2001/09/07 08:41:09 1.1.1.1 --- pkgconf/rules.mak 2001/11/14 14:41:29 *************** *** 137,143 **** TESTS := $(TESTS:.S=) tests.stamp: $(foreach target,$(TESTS),$(target).d $(PREFIX)/tests/$(PACKAGE)/$(target)$(EXEEXT)) ifneq ($(strip $(TESTS)),) ! @cat $(TESTS:=.d) > $(@:.stamp=.deps) endif @touch $@ --- 137,143 ---- TESTS := $(TESTS:.S=) tests.stamp: $(foreach target,$(TESTS),$(target).d $(PREFIX)/tests/$(PACKAGE)/$(target)$(EXEEXT)) ifneq ($(strip $(TESTS)),) ! @cat $(TESTS:%=%.d) > $(@:.stamp=.deps) endif @touch $@
I've made the fix suggested; thanks for that. But I do wonder about what has caused this. I think the "correct" fix is to make sure that trailing spaces cannot be generated at all. Bart, looking at the get_tests() function in host/tools/configtool/common/common/build.cxx should the get_value() method of a CdlValuable strip trailing space? Or should libcdl always leave the value absolutely intact and rely on the caller (i.e. get_tests() here) to do that?
libcdl's get_value() should definitely not strip trailing spaces. It has no way of knowing when spaces are significant or not, e.g. there might be a CYGDAT_ option of some sort containing a message to be displayed to the user. It is only higher-level code such as the makefile generator or the make rules themselves that can take such decisions. In this case I would probably have fixed it slightly differently by e.g. adding a line TESTS := $(strip $(TESTS)) to rules.mak before any other transformations, but the existing fix is fine.