# # Homeworld Windows interface layer makefile # # # Targets and directories # Name = Homeworld Target = Homeworld Link_file = $(Name).lnk SrcDir = . SrcDir2 = $(%HW_Root)\src\game SrcDir3 = $(%HW_Root)\src\Ships SrcDir4 = $(%HW_Root)\src\Sigs SrcDir5 = $(%HW_Root)\src\Titan SrcDir6 = $(%HW_Root)\src\Generated SrcDir7 = $(%HW_Root)\src\jpg LibDir = $(%HW_Root)\Lib TitanLibDir = $(LibDir)\Titan BinkLibDir = $(LibDir)\Smacker Data = $(%HW_Root)\Data KASDirs = $(%HW_Root)\src\SinglePlayer;$(%HW_Root)\src\Tutorials #KASSPRoot = $(Data)\Missions\SinglePlayer #KASTRoot = $(Data)\Missions\Tutorials #KASDirs = $(KASSPRoot)\Mission01;$(KASSPRoot)\Mission02;$(KASSPRoot)\Mission03; & # $(KASSPRoot)\Mission04;$(KASSPRoot)\Mission05;$(KASSPRoot)\Mission06; & # $(KASSPRoot)\Mission07;$(KASSPRoot)\Mission08;$(KASSPRoot)\Mission09; & # $(KASSPRoot)\Mission10;$(KASSPRoot)\Mission11;$(KASSPRoot)\Mission12; & # $(KASSPRoot)\Mission13;$(KASSPRoot)\Mission14;$(KASSPRoot)\Mission15; & # $(KASSPRoot)\Mission16;$(KASSPRoot)\Mission17;$(KASSPRoot)\Mission18; & # $(KASTRoot)\Basic;$(KASTRoot)\Advanced SWDefine = -D_WINSOCK_VERSION=1 # # C compiler and Assembler options (Pentium in our case) # Processor = -G6 # # Default compile and link flags # Link = link LinkFlags0 = /MAP /SUBSYSTEM:WINDOWS,4.0 /NOLOGO /DEBUG /DEBUGTYPE:CV /PDB:NONE LinkFlags1 = /MAP /SUBSYSTEM:WINDOWS,4.0 /NOLOGO /DEBUG:NONE /PDB:NONE LinkFlags2 = /MAP /SUBSYSTEM:WINDOWS,4.0 /NOLOGO /DEBUG /DEBUGTYPE:CV LinkFlags3 = /MAP /SUBSYSTEM:WINDOWS,4.0 /NOLOGO /DEBUG:NONE # Check language !ifeq %HW_Language HW_French Language = HW_French !else !ifeq %HW_Language HW_German Language = HW_German !else Language = HW_English !endif !endif !ifeq %HW_Demo CGW _CCMD = @cl -c -MT -Zp4 -nologo -W2 -DWIN32 -Zl -I$(%HW_Root)\src\win32 -I$(%HW_Root)\src\game -I$(%HW_Root)\src\Ships -I$(%HW_Root)\src\Sigs -I$(%HW_Root)\src\rgl -I$(%HW_Root)\src\Titan -I$(%HW_Root)\src\Titan\inc -I$(%HW_Root)\src\jpg -I$(%HW_Root)\src\rgl\D3D -I$(%HW_Root)\src\rgl\3dfx $(SWDefine) $(Processor) -D$(%HW_Level) -D$(Language) -D$(%USERNAME) -D__MSC__=yes -DCGW _CCMDI = @icl -c -MT -Zp4 -nologo -W2 -DWIN32 -Zl -I$(%HW_Root)\src\win32 -I$(%HW_Root)\src\game -I$(%HW_Root)\src\Ships -I$(%HW_Root)\src\Sigs -I$(%HW_Root)\src\rgl -I$(%HW_Root)\src\Titan -I$(%HW_Root)\src\Titan\inc -I$(%HW_Root)\src\jpg -I$(%HW_Root)\src\rgl\D3D -I$(%HW_Root)\src\rgl\3dfx $(SWDefine) $(Processor) -D$(%HW_Level) -D$(Language) -D$(%USERNAME) -D__MSC__=yes -DCGW -Qwr137 !else !ifeq %HW_Demo Downloadable _CCMD = @cl -c -MT -Zp4 -nologo -W2 -DWIN32 -Zl -I$(%HW_Root)\src\win32 -I$(%HW_Root)\src\game -I$(%HW_Root)\src\Ships -I$(%HW_Root)\src\Sigs -I$(%HW_Root)\src\rgl -I$(%HW_Root)\src\Titan -I$(%HW_Root)\src\Titan\inc -I$(%HW_Root)\src\jpg -I$(%HW_Root)\src\rgl\D3D -I$(%HW_Root)\src\rgl\3dfx $(SWDefine) $(Processor) -D$(%HW_Level) -D$(Language) -D$(%USERNAME) -D__MSC__=yes -DDownloadable _CCMDI = @icl -c -MT -Zp4 -nologo -W2 -DWIN32 -Zl -I$(%HW_Root)\src\win32 -I$(%HW_Root)\src\game -I$(%HW_Root)\src\Ships -I$(%HW_Root)\src\Sigs -I$(%HW_Root)\src\rgl -I$(%HW_Root)\src\Titan -I$(%HW_Root)\src\Titan\inc -I$(%HW_Root)\src\jpg -I$(%HW_Root)\src\rgl\D3D -I$(%HW_Root)\src\rgl\3dfx $(SWDefine) $(Processor) -D$(%HW_Level) -D$(Language) -D$(%USERNAME) -D__MSC__=yes -DDownloadable -Qwr137 !else !ifeq %HW_Demo DLPublicBeta _CCMD = @cl -c -MT -Zp4 -nologo -W2 -DWIN32 -Zl -I$(%HW_Root)\src\win32 -I$(%HW_Root)\src\game -I$(%HW_Root)\src\Ships -I$(%HW_Root)\src\Sigs -I$(%HW_Root)\src\rgl -I$(%HW_Root)\src\Titan -I$(%HW_Root)\src\Titan\inc -I$(%HW_Root)\src\jpg -I$(%HW_Root)\src\rgl\D3D -I$(%HW_Root)\src\rgl\3dfx $(SWDefine) $(Processor) -D$(%HW_Level) -D$(Language) -D$(%USERNAME) -D__MSC__=yes -DDLPublicBeta _CCMDI = @icl -c -MT -Zp4 -nologo -W2 -DWIN32 -Zl -I$(%HW_Root)\src\win32 -I$(%HW_Root)\src\game -I$(%HW_Root)\src\Ships -I$(%HW_Root)\src\Sigs -I$(%HW_Root)\src\rgl -I$(%HW_Root)\src\Titan -I$(%HW_Root)\src\Titan\inc -I$(%HW_Root)\src\jpg -I$(%HW_Root)\src\rgl\D3D -I$(%HW_Root)\src\rgl\3dfx $(SWDefine) $(Processor) -D$(%HW_Level) -D$(Language) -D$(%USERNAME) -D__MSC__=yes -DDLPublicBeta -Qwr137 !else !ifeq %HW_Demo OEM _CCMD = @cl -c -MT -Zp4 -nologo -W2 -DWIN32 -Zl -I$(%HW_Root)\src\win32 -I$(%HW_Root)\src\game -I$(%HW_Root)\src\Ships -I$(%HW_Root)\src\Sigs -I$(%HW_Root)\src\rgl -I$(%HW_Root)\src\Titan -I$(%HW_Root)\src\Titan\inc -I$(%HW_Root)\src\jpg -I$(%HW_Root)\src\rgl\D3D -I$(%HW_Root)\src\rgl\3dfx $(SWDefine) $(Processor) -D$(%HW_Level) -D$(Language) -D$(%USERNAME) -D__MSC__=yes -DOEM _CCMDI = @icl -c -MT -Zp4 -nologo -W2 -DWIN32 -Zl -I$(%HW_Root)\src\win32 -I$(%HW_Root)\src\game -I$(%HW_Root)\src\Ships -I$(%HW_Root)\src\Sigs -I$(%HW_Root)\src\rgl -I$(%HW_Root)\src\Titan -I$(%HW_Root)\src\Titan\inc -I$(%HW_Root)\src\jpg -I$(%HW_Root)\src\rgl\D3D -I$(%HW_Root)\src\rgl\3dfx $(SWDefine) $(Processor) -D$(%HW_Level) -D$(Language) -D$(%USERNAME) -D__MSC__=yes -DOEM -Qwr137 !else _CCMD = @cl -c -MT -Zp4 -nologo -W2 -DWIN32 -Zl -I$(%HW_Root)\src\win32 -I$(%HW_Root)\src\game -I$(%HW_Root)\src\Ships -I$(%HW_Root)\src\Sigs -I$(%HW_Root)\src\rgl -I$(%HW_Root)\src\Titan -I$(%HW_Root)\src\Titan\inc -I$(%HW_Root)\src\jpg -I$(%HW_Root)\src\rgl\D3D -I$(%HW_Root)\src\rgl\3dfx $(SWDefine) $(Processor) -D$(%HW_Level) -D$(Language) -D$(%USERNAME) -D__MSC__=yes _CCMDI = @icl -c -MT -Zp4 -nologo -W2 -DWIN32 -Zl -I$(%HW_Root)\src\win32 -I$(%HW_Root)\src\game -I$(%HW_Root)\src\Ships -I$(%HW_Root)\src\Sigs -I$(%HW_Root)\src\rgl -I$(%HW_Root)\src\Titan -I$(%HW_Root)\src\Titan\inc -I$(%HW_Root)\src\jpg -I$(%HW_Root)\src\rgl\D3D -I$(%HW_Root)\src\rgl\3dfx $(SWDefine) $(Processor) -D$(%HW_Level) -D$(Language) -D$(%USERNAME) -D__MSC__=yes -Qwr137 !endif !endif !endif !endif # # No debug info in externally released .obj files # !ifeq %HW_External HW_Internal CCMD = $(_CCMD) CCMDI = $(_CCMDI) !else CCMD = $(_CCMD) -Zi CCMDI = $(_CCMDI) -Zi !endif # preprocessor used for KAS files !ifeq %HW_Demo CGW CCPRE = @cl /E -nologo -DCGW !else !ifeq %HW_Demo Downloadable CCPRE = @cl /E -nologo -DDownloadable !else !ifeq %HW_Demo OEM CCPRE = @cl /E -nologo -DOEM !else CCPRE = @cl /E -nologo !endif !endif !endif # GLibs = & comdlg32.lib user32.lib gdi32.lib advapi32.lib winmm.lib & kernel32.lib ole32.lib libcp.lib vfw32.lib dsound.lib libcmt.lib & winmm.lib msacm32.lib shell32.lib & $(TitanLibDir)\common_w95.lib $(TitanLibDir)\msg_w95.lib & $(TitanLibDir)\EasySocket_w95.lib $(TitanLibDir)\crypt_w95.lib $(TitanLibDir)\auth_w95.lib & $(BinkLibDir)\binkw32.lib & wsock32.lib ddraw.lib $(LibDir)\d3d\dxguid.lib Libs = $(GLibs) RC = rc /i$(%HW_Root)\src\Game -r RES = $(Name).res KAS2C = KAS2C # # Set suffix order # .EXTENSIONS: .EXTENSIONS: . .exe .lib .obj .pch .c .kas .res .rc .sym .map .lnk .cpp # # C compiler and Assembler options (Pentium in our case) # Processor = -G6 # # Set debugging/optimization options # There are now 3 different build: # HW_Debug - uses VC compiler, full debug, no optimizations # HW_Interim - uses Intel compiler, full debug, no optimizations # HW_anythingelse - uses Intel Compiler, no debug info, optimizations # which CCMD to use is determined in the dependency creation script # CCMD0 = $(CCMD) -Od CCMD1 = $(CCMDI) /Ogitb1 /GsF CCMD2 = $(CCMDI) /Ogitb1 /GsF CCMD0CPP = $(CCMD) -Od /GX /GR CCMD1CPP = $(CCMD) -Od /GX /GR CCMD2CPP = $(CCMD) -Ot /GX /GR !ifeq %HW_Level HW_Debug #debug build - VC compiler, debug info DependName = Debug.depend !ifeq %HW_PDB HW_YESPDB LinkFlags = $(LinkFlags2) !else LinkFlags = $(LinkFlags0) !endif DestDir = $(%HW_Root)\obj\Debug !else # %HW_Level != HW_Debug !ifeq %HW_Level HW_Interim #interim build - Intel compiler, debug info DependName = Interim.depend !ifeq %HW_PDB HW_YESPDB LinkFlags = $(LinkFlags2) !else LinkFlags = $(LinkFlags0) !endif DestDir = $(%HW_Root)\obj\Interim !else # %HW_Level != HW_Interim #Release build - Intel compiler, no debug info, optimizations for most files. DependName = Release.depend !ifeq %HW_PDB HW_YESPDB LinkFlags = $(LinkFlags2) #$(LinkFlags3) !else LinkFlags = $(LinkFlags0) #$(LinkFlags1) !endif DestDir = $(%HW_Root)\obj\Release !endif !endif # # List of object files # Objs = !include $(Name).mif StatLibs = # # Implicit make rules # #.kas: $(KASDirs) #.kas: $(Data)\Missions\SinglePlayer\Mission01 #.kas.c: # @$(KAS2C) $? $(SrcDir6)\$^&.c $(SrcDir6)\$^&.h #.kas.obj: # @$(KAS2C) $? $(SrcDir6)\$^&.c $(SrcDir6)\$^&.h # @$(CCMD) -Fo$(DestDir)\$^&.obj $? .obj: $(DestDir) .c: $(SrcDir);$(SrcDir2);$(SrcDir3);$(SrcDir4);$(SrcDir5);$(SrcDir6);$(SrcDir7) .cpp: $(SrcDir);$(SrcDir2);$(SrcDir3);$(SrcDir4);$(SrcDir5);$(SrcDir6);$(SrcDir7) .c.obj: @$(CCMD) -Fo$(DestDir)\$^&.obj $? .cpp.obj: @$(CCMD) /GX /GR -Fo$(DestDir)\$^&.obj $? .res: $(DestDir) .rc: $(SrcDir) .rc.res: @echo $? @$(RC) -fo$(DestDir)\$^&.res $? # # Convert .map files to .sym files...only useful if using kernel debugger # #.map: $(DestDir) #.sym: $(DestDir) #.map.sym: # mapsym32 -o $*.sym $? # # Explicit make rules # !ifeq %HW_External HW_External all: $(DestDir)\$(Target).exe !else all: $(DestDir)\$(Target).exe rgl.dll !endif !ifeq %HW_External HW_External $(DestDir)\$(Target).exe: $(OBJS) $(DestDir)\$(RES) $(StatLibs) $(DestDir)\$(Link_file) @echo Linking... @$(Link) $(LinkFlags) @$(DestDir)\$(Link_file) @copy $(DestDir)\$(Target).exe $(%HW_Root)\exe\$(Target).exe > NUL: @echo $(DestDir)\$(Target).exe built successfully. !else $(DestDir)\$(Target).exe: $(OBJS) $(DestDir)\$(RES) $(StatLibs) $(DestDir)\$(Link_file) rgl.dll @echo Linking... @$(Link) $(LinkFlags) @$(DestDir)\$(Link_file) @copy $(DestDir)\$(Target).exe $(%HW_Root)\exe\$(Target).exe > NUL: @echo $(DestDir)\$(Target).exe built successfully. !endif $(DestDir)\$(RES): $(Name).rc resource.h # # Explicit make rule for link file # Note: we don't include the .DEF or .RES because there are none yet # $(DestDir)\$(Link_file): makefile $(Name).mif @echo Reconstructing link file @del $(DestDir)\$(Link_file) > NUL: @echo $(LinkFlags) > $(DestDir)\$(Link_file) # @for %i in ($(Objs)) do @echo $(DestDir)\%i >> $(DestDir)\$(Link_file) # @for %i in ($(StatLibs)) do @echo Library %i >> $(DestDir)\$(Link_file) # @for %i in ($(Libs)) do @echo %i >> $(DestDir)\$(Link_file) @perl ..\..\tools\batch\makelnk.pl 0 $(DestDir) $(Link_file) $(Objs) @perl ..\..\tools\batch\makelnk.pl 1 $(DestDir) $(Link_file) $(Libs) @echo $(DestDir)\$(RES) >> $(DestDir)\$(Link_file) @echo -Out:$(DestDir)\$(Target).exe >> $(DestDir)\$(Link_file) !ifeq %HW_External HW_External # no RGL builds for external use... !else rgl.dll: @echo Making rGL ... @cd ..\rgl @wmake /s /h @copy rgl.dll $(%HW_Root)\exe > NUL: @copy rglsw.dll $(%HW_Root)\exe > NUL: @copy rgld3d.dll $(%HW_Root)\exe > NUL: !endif clean: .SYMBOLIC !ifeq %USERNAME gshaw @del /q $(DestDir)\*.* > NUL: @del /q $(SrcDir6)\*.* > NUL: !else @del /q /y $(DestDir)\*.* > NUL: @del /q /y $(SrcDir6)\*.* > NUL: !endif @del ..\rgl\*.lib > NUL: @del ..\rgl\*.dll > NUL: @del ..\rgl\obj\*.obj > NUL: @echo $(Name) Files cleaned successfully. Have to rebuild everything now. hclean: .SYMBOLIC @del /q $(DestDir)\*.* > NUL: @del /q $(SrcDir6)\*.* > NUL: @echo $(Name) Files cleaned successfully. Have to rebuild everything now. copy: .SYMBOLIC @copy $(DestDir)\$(Target).exe $(%HW_Root)\exe\$(Target).exe > NUL: depend: .SYMBOLIC @del $(%HW_Root)\src\Win32\$(DependName) cd $(%HW_Root)\src $(%HW_Root)\tools\bin\perl $(%HW_Root)\tools\batch\depend.pl >Win32\$(DependName) !include $(DependName)