News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

.ifdef and Gnu Assembler = conditional assembly ...

Started by James Ladd, May 27, 2006, 01:06:00 AM

Previous topic - Next topic

James Ladd

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.

hutch--

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.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

James Ladd

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