# This make file was been written with the EXPRESS requirement that it # exists in the "CsMapDev\TestCpp" directory and that directory is # the current working directory of the make executable which is processing # it; with the original intent being that this makefile would be invoked # by a higher level make file which executes something like the following: # # $(MAKE) -fTestCpp.mak # PRJ_NAME = ConsoleTestCpp TRG_BASE = CS_TestCpp TRG_EXT = .exe TRG_NAME = $(TRG_BASE)$(TRG_EXT) # # Set the following default values so that this makefile can be used at # this level. Normally, values for these macros are expected to be provided # on the command line by a parent make process. # VERSION = 90 CONFIGURATION = Release PROCESSOR = x64 CSMAP_LIB_NAME = CsMap # # The following definitions are instituted to facilitate building and # testing multiple versions of the test module. The variables referenced # by these definitions are normally expected to be passed from a parent # makefile on the command line. The default values set here represent # rather generic values which can be useful when in maintenance/development # mode with respect to the test module itself. # SRC_DIR = $(MAKEDIR)\Source OUT_DIR = $(MAKEDIR)\..\bin$(VERSION)\$(CONFIGURATION) LIB_DIR = $(MAKEDIR)\..\lib$(VERSION)\$(CONFIGURATION) INT_DIR = $(MAKEDIR)\..\obj$(VERSION)\$(PRJ_NAME)\$(CONFIGURATION) DICTIONARY_DIR = $(MAKEDIR)\..\Dictionaries # # The following options are chosen to be rather generic; something that # should work in any Windows type environment. More sophisticated # specifications could/should be coded in the parent make file. # CC_FLG = /nologo /I..\Include /MD /O2 /W3 /EHsc /DWIN32 /DNDEBUG /D_WINDOWS CPP_FLG = /nologo /I..\Include /MD /O2 /W3 /EHsc /DWIN32 /DNDEBUG /D_WINDOWS /D__CPP__ # # Adjust the above defines for the various processors, currently only # two: x86 (32 bits) and x64 (64 bit x86). The author has tried without # success to determine exactly how to instruct Microsoft 'cl' compiler to # produce a 64 bit executable. Help in this area would be appreciated. # !IF ("$(PROCESSOR)" == "x64") OUT_DIR = $(OUT_DIR)64 INT_DIR = $(INT_DIR)64 LIB_DIR = $(LIB_DIR)64 !ENDIF # # The following define the supporting objects which must be available to # the linker to build the test module. Possible candidate for its own library, # but not yet. Note that CStest0.cpp is essentially this project's equivalent # of stdhdr.cpp; used to simply pre-compile the headers for the remaining # .cpp modules. # # This listing of dependencies needs to be hard coded as NMAKE does not # have much in the way of list manipulation capabilities. So, adding # a new module to this build requires that an entry to this list of # object modules, and an entry to the dependency rules given below, be # manually made. Not much of price to pay given the build speed # advantages gained. # TRG_OBJECTS = $(INT_DIR)\CS_osGeoTest.obj \ $(INT_DIR)\CStest1.obj \ $(INT_DIR)\CStest2.obj \ $(INT_DIR)\CStest3.obj \ $(INT_DIR)\CStest4.obj \ $(INT_DIR)\CStest5.obj \ $(INT_DIR)\CStest6.obj \ $(INT_DIR)\CStest7.obj \ $(INT_DIR)\CStest8.obj \ $(INT_DIR)\CStest9.obj \ $(INT_DIR)\CStestA.obj \ $(INT_DIR)\CStestB.obj \ $(INT_DIR)\CStestC.obj \ $(INT_DIR)\CStestD.obj \ $(INT_DIR)\CStestE.obj \ $(INT_DIR)\CStestF.obj \ $(INT_DIR)\CStestG.obj \ $(INT_DIR)\CStestH.obj \ $(INT_DIR)\CStestI.obj \ $(INT_DIR)\CStestJ.obj \ $(INT_DIR)\CStestK.obj \ $(INT_DIR)\CStestL.obj \ $(INT_DIR)\CStestM.obj \ $(INT_DIR)\CStestN.obj \ $(INT_DIR)\CStestQ.obj \ $(INT_DIR)\CStestR.obj \ $(INT_DIR)\CStestS.obj \ $(INT_DIR)\CStestT.obj \ $(INT_DIR)\CStestW.obj \ $(INT_DIR)\CStestSupport.obj # # Define the primary targets of this make file. # ALL : $(OUT_DIR)\$(TRG_NAME) # # Since the code and the resulting object codes are desired to # reside in separate directories for many and various reasons, we # need this bit of ugliness to define explicit dependencies. Doing # so enables the encoded "search path batch inference rules" to work, # and when you can get them to work in NAMKE, they work wonderfully. # $(INT_DIR)\CS_osGeoTest.obj : $(SRC_DIR)\CS_osGeoTest.cpp $(INT_DIR)\CStest1.obj : $(SRC_DIR)\CStest1.cpp $(INT_DIR)\CStest2.obj : $(SRC_DIR)\CStest2.cpp $(INT_DIR)\CStest3.obj : $(SRC_DIR)\CStest3.cpp $(INT_DIR)\CStest4.obj : $(SRC_DIR)\CStest4.cpp $(INT_DIR)\CStest5.obj : $(SRC_DIR)\CStest5.cpp $(INT_DIR)\CStest6.obj : $(SRC_DIR)\CStest6.cpp $(INT_DIR)\CStest7.obj : $(SRC_DIR)\CStest7.cpp $(INT_DIR)\CStest8.obj : $(SRC_DIR)\CStest8.cpp $(INT_DIR)\CStest9.obj : $(SRC_DIR)\CStest9.cpp $(INT_DIR)\CStestA.obj : $(SRC_DIR)\CStestA.cpp $(INT_DIR)\CStestB.obj : $(SRC_DIR)\CStestB.cpp $(INT_DIR)\CStestC.obj : $(SRC_DIR)\CStestC.cpp $(INT_DIR)\CStestD.obj : $(SRC_DIR)\CStestD.cpp $(INT_DIR)\CStestE.obj : $(SRC_DIR)\CStestE.cpp $(INT_DIR)\CStestF.obj : $(SRC_DIR)\CStestF.cpp $(INT_DIR)\CStestG.obj : $(SRC_DIR)\CStestG.cpp $(INT_DIR)\CStestH.obj : $(SRC_DIR)\CStestH.cpp $(INT_DIR)\CStestI.obj : $(SRC_DIR)\CStestI.cpp $(INT_DIR)\CStestJ.obj : $(SRC_DIR)\CStestJ.cpp $(INT_DIR)\CStestK.obj : $(SRC_DIR)\CStestK.cpp $(INT_DIR)\CStestL.obj : $(SRC_DIR)\CStestL.cpp $(INT_DIR)\CStestM.obj : $(SRC_DIR)\CStestM.cpp $(INT_DIR)\CStestN.obj : $(SRC_DIR)\CStestN.cpp $(INT_DIR)\CStestQ.obj : $(SRC_DIR)\CStestQ.cpp $(INT_DIR)\CStestR.obj : $(SRC_DIR)\CStestR.cpp $(INT_DIR)\CStestS.obj : $(SRC_DIR)\CStestS.cpp $(INT_DIR)\CStestT.obj : $(SRC_DIR)\CStestT.cpp $(INT_DIR)\CStestW.obj : $(SRC_DIR)\CStestW.cpp $(INT_DIR)\CStestSupport.obj : $(SRC_DIR)\CStestSupport.cpp # # Note that there are no plain 'C' modules in this build. Thus this # makefile is somewhat simplified. # {$(SRC_DIR)}.cpp{$(INT_DIR)}.obj:: cl /c /I./Include $(CPP_FLG) /Fp$(INT_DIR)\$(PRJ_NAME).pch /YucsTestCpp.hpp /Fo$(INT_DIR)\ $< # # CStest0 is special in that it generates the pre-compiled header file for all # the other object modules. # $(INT_DIR)\CStest0.obj : $(SRC_DIR)\CStest0.cpp cl /c /I./Include $(CPP_FLG) /Fo$(INT_DIR)\CStest0.obj /Fp$(INT_DIR)\$(PRJ_NAME).pch \ /YccsTestCpp.hpp \ $(SRC_DIR)\CStest0.cpp $(INT_DIR)\$(TRG_BASE).obj : $(SRC_DIR)\$(TRG_BASE).cpp $(INT_DIR)\CStest0.obj cl /c /I./Include $(CPP_FLG) /Fo$(INT_DIR)\$(TRG_BASE).obj /Fp$(INT_DIR)\$(PRJ_NAME).pch \ /YccsTestCpp.hpp \ $(SRC_DIR)\$(TRG_BASE).cpp $(OUT_DIR)\$(TRG_NAME) : $(INT_DIR)\$(TRG_BASE).obj $(TRG_OBJECTS) \ $(LIB_DIR)\$(CSMAP_LIB_NAME).lib cl /Fe$(OUT_DIR)\$(TRG_NAME) $(INT_DIR)\$(TRG_BASE).obj \ $(TRG_OBJECTS) \ $(LIB_DIR)\$(CSMAP_LIB_NAME).lib $(LIB_DIR)\$(CSMAP_LIB_NAME).lib : cd $(MAKEDIR)\..\Source $(MAKE) -f Library.nmk "VERSION=$(VERSION)" \ "CONFIGURATION=$(CONFIGURATION)" \ "PROCESSOR=$(PROCESSOR)" \ "CC_FLG=$(CC_FLG)" \ "CPP_FLG=$(CPP_FLG)" cd $(MAKEDIR) clean : del /F $(INT_DIR)\*.obj del /F $(INT_DIR)\*.pch del /F $(OUT_DIR)\$(TRG_NAME) rebuild: clean $(OUT_DIR)\$(TRG_NAME) # # Create the intermediary and output directories if they don't exist. # $(INT_DIR)\CStest0.obj : $(INT_DIR) $(INT_DIR)\$(TRG_BASE).obj : $(INT_DIR) $(OUT_DIR)\$(TRG_NAME) : $(OUT_DIR) $(INT_DIR) : mkdir $(INT_DIR) $(OUT_DIR) : mkdir $(OUT_DIR)