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

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.
0
naseeam
Asked:
naseeam
  • 2
  • 2
2 Solutions
 
grg99Commented:
that's one of the obscurer features of gnu make.  See the gnu make manual:

 This statement:

     FOO ?= bar

is exactly equivalent to this (see The origin Function):

     ifeq ($(origin FOO), undefined)
       FOO = bar
     endif
0
 
pegasysCommented:
This is where the clearmake (or make) see what architecture and framework it has to run on.

seeing as you are compiling on Windows XP (which is Windows NT based), that should be fine...
0
 
pegasysCommented:
erm sorry, I forgot to make that a proposed solution...
0
 
naseeamAuthor Commented:
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.
0
 
grg99Commented:
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.  

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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