Bug 56239

Summary: make tests rules improvment
Product: [Retired] eCos Reporter: Andrew Lunn <andrew.lunn>
Component: Patches and contributionsAssignee: Jonathan Larmour <jlarmour>
Status: CLOSED CURRENTRELEASE QA Contact: Jonathan Larmour <jlarmour>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.5.2CC: bartv
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-12-07 14:49:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andrew Lunn 2001-11-14 14:49:18 UTC
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 $@

Comment 1 Jonathan Larmour 2001-11-21 18:00:16 UTC
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?


Comment 2 Bart Veer 2001-12-07 14:49:30 UTC
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.