[ECOS] PKGconf.mak problem

Jonathan Larmour jlarmour@cygnus.co.uk
Wed Aug 18 08:24:00 GMT 1999

In article < 37BAA355.76EDE274@netinsight.se > you write:
>I found a (minor) problem with the ecos make system.
>Even if I explicitly name file 'testfile.S' in the COMPILE entry of
>PKGconf.mak, the file 'testfile.c' will be compiled instead (if it exists).

Hmm... yes. This is because we rely on the default build rules for GNU make.
So it is just told to build "testfile.o", and GNU make will just rebuild
the one it thinks of first :-/.

We're currently revamping the build system, so unless someone out there
thinks it is worth submitting a patch, there won't be an outright fix.

As a workaround you should be able to add a specific make rule to build
testfile.S. This is completely off the top of my head with the aid of cut and
paste, and therefore likely to be wrong, but here's an outline of what's
probably needed:

OTHER_TARGETS := testfile_s.stamp
OTHER_DEPS := testfile_s.d
OTHER_CLEAN := testfile_s.clean

.PHONY: testfile_s.clean

testfile_s.stamp: testfile_s.o
        $(AR) rcs $(PREFIX)/lib/$(LIBRARY) $?
        $(TOUCH) $@

testfile_s.o: testfile.S
        $(CXX)  -c $(INCLUDE_PATH) $(CFLAGS) -Wp,-MD,$(@:.o=.tmp) -o $@ $<
        @echo > $(@:.o=.d)
        @echo $@ ':' $< '\' >> $(@:.o=.d)
        @$(TAIL) +2 $(@:.o=.tmp) >> $(@:.o=.d)
        @$(RM) $(@:.o=.tmp)

        $(RM) testfile_s.stamp
        $(RM) testfile_s.o
Cygnus Solutions, 35 Cambridge Place, Cambridge, UK.  Tel: +44 (1223) 728762
"I used to have an open mind but || Get yer free open source RTOS's here...
 my brains kept falling out."    || http://sourceware.cygnus.com/ecos
Help fight spam! http://spam.abuse.net/  These opinions are all my own fault

More information about the Ecos-discuss mailing list