help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Conditional build


From: Andrew Small
Subject: Conditional build
Date: Tue, 11 Apr 2006 15:38:47 +0100

I need to switch a build between for ROM and RAM.
At the moment, I have a line near the top of the file:
RUNFROMFLASH=yes

and then:
ifeq ($(RUNFROMFLASH),yes)
# Run from Flash configuration files
PROGNAME = flashweb
NG_DEF += ,RTE_FLASH
OBJS += hwsetup.$(NGOEXT) sections.$(NGOEXT)
endif

a sub-makefile also switches the linker sections between ROM & RAM depending
on the value of RUNFROMFLASH.

This is OK, but I'd rather it was streamlined so that the makefile itself
did not need modifying to switch between build options. For example:
gmake -fshc.mk clean    ; clean build.
gmake -fshc.mk ram      ; build for ram.
gmake -fshc.mk          ; build for rom.
gmake -fshc.mk rom      ; build for rom (as above).


I tried prepending the .mk file with:
rom:
    RUNFROMFLASH=yes
    all

ram:
    RUNFROMFLASH=no
    all

all:

but it fails on the third line "   all" with:
C:>gmake -fshc.mk clean
shc.mk:3: *** missing separator.  Stop. 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]