Complex Projects with a META-Makefile

I have a C++ project that is made up of many other projects that have certain dependencies. Now I want to build this project with nmake ( release and debug ) but I dont know how to write such a script for it. I think of using recursive calls to nmake for each project's makefile and setting the dependencies via targets and dependents in the "meta-makefile". How can this be done??
LVL 1
kdkdAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
jkrConnect With a Mentor Commented:
Simply use a makefile similar to this one:

DIRS = \
    dll\~   \
    generic\~   \
    simple\~   \
    winhelp\~   \


SDKPROJ =Begin


#
# This is a Platform SDK non-leaf-node makefile.  It is used to allow NMAKE,
#  or a similar tool, to recursively build all of the samples in a directory
#  tree.  To add or remove a directory from the build process, modify the
#  DIRS list above.  
#
# The SDKPROJ macro (above) is defined solely for the purpose of echoing
#  the current directory location to the screen.  
#
# Do not modify this makefile except for the DIRS and SDKPROJ macros above.
#

#
# Include sdkpropbld.mak in order to get standard build options, environment
#  variables, and macros.  The sdkpropbld.mak file is installed with the SDK
#  in the include directory.
#

!include <sdkpropbld.mak>

#
# In order to build "all," process each of the entries in the DIRS list.
#

all: $(DIRS)


#
# In order to build each of the entries in the DIRS list, change dir into the
#  directory in question, echo the current location, run nmake recursively,
#  and change dir back to the original directory level.  This four step process
#  is encapsulated in sdkbld.mak which is installed with the SDK in the include
#  directory.
#

$(DIRS):
!include <sdkbld.mak>

(this is taken from an MS example, but it can easily be adapted to suite your needs)

Feel free to ask if you nee more information!
0
All Courses

From novice to tech pro — start learning today.