[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help required in gnumake
From: |
beginner beginner |
Subject: |
Re: Help required in gnumake |
Date: |
Tue, 5 Aug 2003 23:48:20 -0700 (PDT) |
Here is the code snippet
%.obj: %.c
@echo Start building <<<It works>>>>
ifeq ($(DEF_OBJDIR),)
@echo Set the value <<<<<<<This echo works fine>>>>>>>
DEF_OBJDIR=$(OBJDIR)
endif
#######################################################################################################
# Set the DEF_OBJDIR as ..\obj <<<<Can you let me know how to check this
value>>>>
########################################################################################################
ifneq ($(DEF_OBJDIR),$(OBJDIR_UNOPT))
ifneq ($(MCC_FLAGS),)
@echo test
DEF_CC_FLAGS=$(MCC_FLAGS)
else <<<<My Test comes here>>>>>
@echo test <<<<It should print this but give me warning that ***
commands commence before first target. Stop.>>>>>>>>
DEF_CC_FLAGS=$(CC_FLAGS)
endif
Thanks,
Amit
--- "Paul D. Smith" <address@hidden> wrote:
>%% beginner beginner <address@hidden> writes:
>
> bb> Thanks I got the probelm of Space and TAB.
> bb> As per http://www.gnu.org/manual/make-3.77/html_chapter/make_16.html It
> says
> bb> for error `commands commence before first target. Stop.'
>
> bb> " This means the first thing in the makefile seems to be part of a
> bb> command script: it begins with a TAB character and doesn't appear
> bb> to be a legal make command (such as a variable
> bb> assignment). Command scripts must always be associated with a
> bb> target. The second form is generated if the line has a semicolon
> bb> as the first non-whitespace character; make interprets this to
> bb> mean you left out the "target: dependency" section of a rule. "
>
>Exactly.
>
> bb> Now if I type OFFICIAL = 10 after TAB it works
> bb> but if I type echo after TAB it does not work
>
>This means, just as the manual says, your makefile contains a command
>script (the echo) _before_ you've defined a target that the command
>script should apply to.
>
>OFFICIAL = 10 is interpreted as a make variable setting, not a command
>string, in this situation so it doesn't elicit an error.
>
> bb> Please help.
>
>If you still don't understand, post a small example makefile that fails
>and we'll show you what's wrong with it.
>
>--
>-------------------------------------------------------------------------------
> Paul D. Smith <address@hidden> Find some GNU make tips at:
> http://www.gnu.org http://make.paulandlesley.org
> "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
_____________________________________________________________
Get Your Private, Free Jatt Email at http://www.jatt.com/