2011/8/25 Frédéric Nadeau <[email protected]>: Looks like you are making a library per peripheral of all of the devices?
> I was looking for a > way to have recipe for all device so it could take advantage of parallel > build. "Secondary Expansion" that was added in GNU Make 3.81 might help, at least in dealing with multiple targets: http://www.gnu.org/s/hello/manual/make/Secondary-Expansion.html I use it to build different projects from the same set of source files. Relevant to building each device's output directory etc. # See http://www.cmcrossroads.com/ask-mr-make/6936-making-directories-in-gnu-make #From Mr. Make at the above URL. ... ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) # In GNU Make 3.81 there's an exciting new feature called 'second # expansion' (which is enabled by specifying the .SECONDEXPANSION # target in the Makefile). With second expansion the prerequisite # list of any rule under goes a second expansion (the first expansion # happens when the Makefile is read) just before the rule is used. By # escaping any $ signs with a second $ it's possible to use GNU Make # automatic variables in the prerequisite list. # We use this to build the empty directory structure if it does not exist. [Relevant to building each device's output directory etc.] # See the @D rules later in this file. .SECONDEXPANSION: # Default target. all: begin gccversion sizebefore build sizeafter end Makefile.mak [different models.mak go here] compiler.mak MakefileOptions.inc ... # Compile: create object files from C source files. $(OBJDIR)/%.o : %.c $$(@D)/.keep @echo @echo $(MSG_COMPILING) $< $(CC) -c $(ALL_CFLAGS) $< -o $@ [Others get the $$(@D)/.keep as well.] %/.keep: mkdir -p $(dir $@) touch $@ .PRECIOUS: %/.keep # The pattern rule used to make .o files has a special prerequisite # $$(@D)/.keep which uses the second expansion feature to obtain the # directory in which the target (from $@ using the D modifier) is to # be built. # That directory will be built by the %/.keep pattern rule that knows how # to build a .keep file (and the containing directory). Notice that the # .keep files are marked as precious so that GNU Make will not delete # them. Without this line the .keep files are considered to be useless # intermediate files and would be cleaned up by GNU Make on exit. # See http://www.cmcrossroads.com/ask-mr-make/6936-making-directories-in-gnu-make _______________________________________________ AVR-libc-dev mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/avr-libc-dev
