Bug 56239 - make tests rules improvment
Summary: make tests rules improvment
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: eCos
Classification: Retired
Component: Patches and contributions
Version: 1.5.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jonathan Larmour
QA Contact: Jonathan Larmour
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-11-14 14:49 UTC by Andrew Lunn
Modified: 2007-04-18 16:38 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-12-07 14:49:36 UTC
Embargoed:


Attachments (Terms of Use)

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.




Note You need to log in before you can comment on or make changes to this bug.