• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1936
  • Last Modified:

nmake IFDEF

i have a make file which contains following lines

fndef CFLAGS
CFLAGS = -MMD -O2 -Wall
endif

when i used nmake (on windows platform )  to run this makefile  , it shows error
***********************
makefile(17) : fatal error U1034: syntax error : separator missing
Stop.
***************************




0
karana
Asked:
karana
  • 5
  • 3
1 Solution
 
Infinity08Commented:
I assume that fndef is a typo, and that it actually says ifndef ?
0
 
Infinity08Commented:
>> makefile(17) : fatal error U1034: syntax error : separator missing

Which line is that ?
0
 
Infinity08Commented:
>> nmake

Ah. If I'm not mistaken, you have to use this instead :

!IFNDEF CFLAGS
CFLAGS = -MMD -O2 -Wall
!ENDIF
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
cybrexusCommented:
depends on the version of nmake but sometimes you'll need two !! with endif - so !!endif
0
 
karanaAuthor Commented:
i tried some trail and error


fndef CFLAGS:
CFLAGS = -MMD -O2 -Wall
endif:

now it shows no error ...is it correct ?


0
 
Infinity08Commented:
>> now it shows no error

Again fndef instead of ifndef.

Also, can you tell which line exactly the syntax error refers to ? (as I asked earlier)


>>  ...is it correct ?

I would think not, as the :'s at the end of the line signify labels rather than conditionals.


Did you read our suggestions ?
0
 
karanaAuthor Commented:
we tried the below

!IFNDEF CFLAGS
CFLAGS = -MMD -O2 -Wall
!ENDIF

but , it show the same error on first line .
0
 
Infinity08Commented:
Are you sure that line is in a position where it is allowed to be ? Can you show the entire makefile ?
0
 
karanaAuthor Commented:
i was wrong ....
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now