|
From: | James Hsu |
Subject: | Re: OT: [avr-gcc-list] How to make to variants with one makefile? |
Date: | Mon, 22 Nov 2004 14:15:45 -0800 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113 |
Anton Erasmus wrote:
Yikes, thats a fun approach. Then again, the stuff I'm working on is even sloppier...I have a single set of source that supports a number of different versions of a PCB with some differences in capabilities. I also use either an ATmega8 on one PCB or an ATMega16 or ATMega32 on the other PCBs. Currently I have to define the MCU as well as one other define in the makefile.
You really should look at the GNU Make info page. I'm pretty much learning this stuff as I go along and since Make isn't going to go anywhere anytime soon, I figure it's a pretty good investment of time. Anyhow,
try something like this: PCBOPT = opt1 opt2 MMCU = atmega8 atmega16 atmega32TARGETS := $(foreach pcbopt, $(PCBOPT), $(foreach mmcu, $(MMCU), $(pcbopt)_$(mmcu)))
tmp: $(TARGETS) $(TARGETS): @echo address@hidden which spits out: address@hidden:~$ make opt1_atmega8.rom opt1_atmega16.rom opt1_atmega32.rom opt2_atmega8.rom opt2_atmega16.rom opt2_atmega32.rom James
[Prev in Thread] | Current Thread | [Next in Thread] |