Link to home
Start Free TrialLog in
Avatar of naseeam
naseeamFlag for United States of America

asked on

What does "OS ?= Windows_NT" mean in a makefile?

My OS is Windows XP.  My make program is clearmake with GNU compatibility.  We have number of makefiles that are used to make our libraries and applications.  The first few lines of very first makefile that runs are as follows:

########################################################################
# src/makefiles/Makefile.mk                             clearmake -C gnu
########################################################################

# This supports recursive build of a library or application release for
# all supported targets.

# OS - define the host operating system
# Default to Windows_NT if undefined
#
OS ?= Windows_NT

My question is as follows:
Please explain      OS ?= Windows_NT.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of grg99
grg99

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Adrian Sluijters
Adrian Sluijters
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
erm sorry, I forgot to make that a proposed solution...
Avatar of naseeam

ASKER

When does clearmake see what architecture and framework it has to run on?  Another words, when does line OS ?= WINDOWS_NT excute?  When we type clearmake target, then I believe line in the makefile that contains target and it's dependencies executes first.  When does OS ?= WINDOWS_NT execute?  What is the order of exection?   Thanks.
Avatar of grg99
grg99

If this line is before any of the targets, I think it gets executed every time before the target lines get executed.


If you don't define OS=something on the make command line, then the make file sees that OS is undefined, and it sets it to WINDOWS_NT.