--- mstools/mfc/samples/dlltrace/makefile 2018/08/09 18:24:57 1.1 +++ mstools/mfc/samples/dlltrace/makefile 2018/08/09 18:27:54 1.1.1.2 @@ -4,40 +4,68 @@ # # This source code is only intended as a supplement to the # Microsoft Foundation Classes Reference and Microsoft -# QuickHelp documentation provided with the library. +# documentation provided with the library. # See these sources for detailed information regarding the # Microsoft Foundation Classes product. # # Build hello1 application and Tracer DLL -DEBUG=1 +# Options to NMAKE: +# "OPT" => use to set custom compile options +# "PLATFORM=INTEL" (defaults to INTEL) +# This option chooses the appropriate tools and sources for the +# different platforms support by Windows/NT. Currently INTEL and +# MIPS are supported; more will be aded as they become available. -goal: hello1.exe tracer.dll -############################################################################# -# hello1 application is medium model DEBUG +!if "$(PLATFORM)"=="" +PLATFORM=ALPHA +!endif -!ifdef WIN16MFC +DEBUGFLAGS = /Z7 /Od /D_DEBUG +MFCLIB=..\..\lib\nafxcwd.lib +MFCLIBDLL=..\..\lib\nafxdwd.lib + +!if "$(PLATFORM)"=="INTEL" +CPUFLAGS = /D_X86_ +CPP = cl +LINK = link +LIB32 = lib +MFCDLLENTRY = +!else +!if "$(PLATFORM)"=="MIPS" +CPUFLAGS = /D_MIPS_ +CPP = mcl +LINK = link32 +LIB32 = lib32 +MFCDLLENTRY = -entry:DllMain +!else +!if "$(PLATFORM)"=="ALPHA" +CPUFLAGS = +CPP = claxp +LINK = link32 +LIB32 = lib32 +MFCDLLENTRY = -entry:DllMain +!endif +!endif +!endif -hello1.obj: hello1.cpp resource.h traceapi.h - cl /DWINVER=0x0300 /AM /Zi /Zp /D_DEBUG /c hello1.cpp +MFCFLAGS=/D_WINDOWS +CPPFLAGS = /c /W3 $(DEBUGFLAGS) $(MFCFLAGS) $(CPUFLAGS) $(OPT) +GUIFLAGS = -debug:full -debugtype:both -subsystem:windows -entry:WinMainCRTStartup + +GUILIBS = user32.lib gdi32.lib \ + winspool.lib comdlg32.lib advapi32.lib \ + olecli32.lib olesvr32.lib shell32.lib \ + kernel32.lib libc.lib -hello1.exe: hello1.obj hello1.def hello1.res tracer.lib - link /NOD /CO /ONERROR:NOEXE @<< -hello1, -hello1.exe, -nul, -mafxcwd libw mlibcew tracer, -hello1.def; -<< - rc -30 /t hello1.res +GUILIBSDLL = $(GUILIBS) -hello1.res: hello1.rc resource.h hello1.ico +goal: hello1.exe tracer.dll -!else -!include ..\ntsample.mak +############################################################################# hello1.obj: hello1.cpp resource.h traceapi.h $(CPP) $(CPPFLAGS) hello1.cpp @@ -46,53 +74,66 @@ hello1.exe: hello1.obj hello1.def hello1 $(LINK) $(GUIFLAGS) -out:hello1.exe hello1.obj tracer.lib hello1.res $(MFCLIB) $(GUILIBS) hello1.res: hello1.rc resource.h hello1.ico - +!if "$(PLATFORM)"=="INTEL" + rc -r hello1.rc +!else +!if "$(PLATFORM)"=="MIPS" + rc -r -fo hello1.rct hello1.rc + cvtres -MIPS -o hello1.res hello1.rct + -erase hello1.rct +!else +!if "$(PLATFORM)"=="ALPHA" + rc -r -fo hello1.rct hello1.rc + cvtres -ALPHA -o hello1.res hello1.rct + -erase hello1.rct +!endif +!endif !endif ############################################################################# -# Tracer is a large model DLL built with MFC large model debug DLL support -# library - -# /GD option automatically defines /D_WINDLL -!ifdef WIN16MFC tracer.obj: tracer.cpp traceapi.h - cl /DWINVER=0x0300 /ALw /Zi /GD /Gs /W3 /Zp /D_DEBUG /c tracer.cpp - -tracer.dll: tracer.obj tracer.def tracer.res - link /NOD /ONERROR:NOEXE /CO /PACKDATA @<< -tracer.obj, -tracer.dll, -nul, -lafxdwd libw ldllcew, -tracer.def; -<< - rc -30 /t tracer.res tracer.dll - -# import library -tracer.lib: tracer.dll - implib tracer.lib tracer.dll - -!else - -MFCLIB1=nafxdwd.lib - -tracer.obj: tracer.cpp traceapi.h - $(CPP) $(CPPFLAGS) /D_WINDLL /c /Zi tracer.cpp + $(CPP) $(CPPFLAGS) /D_WINDLL /D_USRDLL tracer.cpp tracer.dll: tracer.obj tracer.res tracer.lib $(LINK) -debug:full -debugtype:cv -dll -out:tracer.dll \ -subsystem:windows \ - -entry:$(MFCDLLENTRY) -base:0x1C000000 \ -map:tracer.map \ + $(MFCDLLENTRY) \ + -base:0x1C000000 \ tracer.obj tracer.res tracer.exp \ $(MFCLIBDLL) $(GUILIBSDLL) -# import library -tracer.lib: tracer.obj tracer1.def - $(LIB32) -machine:$(CPU) -def:tracer1.def tracer.obj -out:tracer.lib +tracer.res: tracer.rc traceres.h +!if "$(PLATFORM)"=="INTEL" + rc -r tracer.rc +!else +!if "$(PLATFORM)"=="MIPS" + rc -r -fo tracer.rct tracer.rc + cvtres -MIPS -o tracer.res tracer.rct + -erase tracer.rct +!else +!if "$(PLATFORM)"=="ALPHA" + rc -r -fo tracer.rct tracer.rc + cvtres -ALPHA -o tracer.res tracer.rct + -erase tracer.rct +!endif +!endif +!endif +# import library +tracer.lib: tracer.obj +!if "$(PLATFORM)"=="INTEL" + $(LIB32) -machine:i386 -def:tracer.def tracer.obj -out:tracer.lib +!else +!if "$(PLATFORM)"=="MIPS" + $(LIB32) -machine:mips -def:tracer.def tracer.obj -out:tracer.lib +!else +!if "$(PLATFORM)"=="ALPHA" + $(LIB32) -machine:alpha -def:tracer.def tracer.obj -out:tracer.lib +!endif +!endif !endif #############################################################################