This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

arm-elf-as dependency generation


Bryce Schober writes:
 > I'm trying to work out a makefile structure that utilizes the concepts 
 > found at http://make.paulandlesley.org/autodep.html.  So far, everything 
 > is working great, except that the dependency generation is whacked for 
 > .S files when using arm-elf-gcc and passing the options through to 
 > arm-elf-as, and using arm-elf-as is a pain because it doesn't like our 
 > cpp-style comments.
 > 
 > $ arm-elf-gcc -c -nostartfiles -Wa,-MD,crt0.d crt0.S -o crt0.o
 > $ cat crt0.d
 > crt0.o: <command\ line> <built-in> crt0.S \
 >   /cygdrive/c/DOCUME~1/bks/LOCALS~1/Temp/cckg0JqA.s
 > $ arm-elf-as -MD crt0.d crt0.S -o crt0.o
 > $ cat crt0.d
 > crt0.o: crt0.S
 > 
 > Any ideas here, or should I just buck up and de-cpp my assembly files?

Note: there's no need to pass -nostartfiles if you're also passing -c.

I'm curious why you've decided to not try using the newer gcc
dependency generation features (as outlined in a previous message
of mine).  According to Paul's web page it was lasted updated in 2000.
It's pretty old.  The newer features of gcc obviate the need for much of the
complication present in "the old newer way" (so to speak).


Note: I've clipped the prose from the appended message since it is a resend.
---

From: Doug Evans <dje@casey.transmeta.com>
Date: Thu, 25 Sep 2003 11:35:19 -0700 (PDT)
To: rose@acm.org
Cc: Bryce Schober <bryceman@dpzone.com>,
    crossgcc@sources.redhat.com
Subject: Re: Makefile best practices for embedded development

[...]

e.g. add this to your Makefile (NOTE: requires GNU make):

# NOTE: It is important to include the file extension in the
# dependence-file names so that files with the same stem
# but different extensions don't step on each other.

%.o: %.c $(CC1_DEPENDENCY) $(AS_DEPENDENCY)
	$(CC_FOR_TARGET) $(ALL_CFLAGS_FOR_TARGET) -Wp,-M,-MP,-MT,$(*F).o,-MF,.deps/$(@F).p -c $<

%.o: %.S $(AS_DEPENDENCY)
	$(CC_FOR_TARGET) $(ALL_SFLAGS_FOR_TARGET) -Wp,-M,-MP,-MT,$(*F).o,-MF,.deps/$(@F).p -c $<

# Utility rule to clean out .deps dirs.
clean: clean-my-dot-deps
clean-my-dot-deps:
	rm -f .deps/*

# This actually includes the dependencies that were generated during the
# previous build by the default rules (e.g. .c->.o).

DEP_FILES = $(shell mkdir -p .deps >&/dev/null) $(wildcard .deps/*)
-include $(DEP_FILES)

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]