I know that Gnu Assembler supports the .ifdef directive, but what I cant seem to find is
the list of symbols that you can .ifdef on without defining them yourself.
Im using this manual:
http://sources.redhat.com/binutils/docs-2.12/as.info/index.html#Top
What I want to do is .ifdef include a file based on the platform.
eg: .ifdef WIN32
What I dont want to do is have to specify the symbol WIN32 in the command line
but do I have a choice?
Im thinking I could do a --defsym OS=%OS%
as OS is defined as Windows_NT under XP.
My goal is not to specify anything that I dont have to.
Any help of pointers to a better source of GAS information would be appreciated.
Update: I have found that make recognises the environment variable OS in
the Makefile under cygwin as 'Windows_NT', but doesnt do the same under
Linux. At least the precense can be used in one to make a default.
Strangely, when I do the Gnu Makefile ifeq ($(OS),Windows_NT)
then I get a make error
ifeq (Windows_NT,Windows_NT)
/bin/sh: -c: line 0: syntax error near unexpected token `Windows_NT,Windows_NT'
/bin/sh: -c: line 0: `ifeq (Windows_NT,Windows_NT)'
make: *** [simple.o] Error 2
Which doesnt make much sense to me. Does anyone have any ideas?
Rgs, James.
James,
The only source I used when playing with GAS was the stuff from MIngw and I doubt its much different to what you have.
I worked out my issues and it was where I placed the .ifdef/ifeq that made the difference.
See post here for details:
http://www.masm32.com/board/index.php?topic=4831.0