home *** CD-ROM | disk | FTP | other *** search
Makefile | 2000-05-04 | 2.9 KB | 111 lines |
- ###############################################################################
- #
- # Copyright (C) Microsoft Corporation 1995-1999
- # All Rights Reserved.
- #
- # Sample heap profiler makefile
- #
- ###############################################################################
-
-
- ####################
- # macro definitions
- ####################
-
- BASE_NAME = heapmon
-
-
- SDK_ROOT = ..\..\..
- SDK_INC = $(SDK_ROOT)\Include
- SDK_LIB = $(SDK_ROOT)\Lib\i386
-
- !if "$(CFG)" == ""
- CFG = debug
- !endif
-
- !if "$(CFG)" != "debug" && "$(CFG)" != "release" && "$(CFG)" != "all"
- !error Invalid build configuration "$(CFG)". Must be "debug", "release", or "all".
- !endif
-
- !if "$(CFG)" == "debug"
- DEFINES = -DDEBUG
- CL_OPT_SWITCHES = -Od -Zi
- JVC_OPT_SWITCHES = -g -x- -nomessage -nologo
- !else
- DEFINES = -DNDEBUG
- CL_OPT_SWITCHES = -Ox
- JVC_OPT_SWITCHES = -O
- !endif
-
- CL_SWITCHES = -W4 -WX -MT -I$(SDK_INC:;= -I) $(CL_OPT_SWITCHES) $(DEFINES)
-
- DEST = $(CFG)
-
-
- LIBS = user32.lib libcmt.lib kernel32.lib comctl32.lib uuid.lib advapi32.lib ole32.lib shell32.lib
-
- OBJS = \
- $(DEST)\baseview.obj \
- $(DEST)\clsview.obj \
- $(DEST)\gcview.obj \
- $(DEST)\guids.obj \
- $(DEST)\heapview.obj \
- $(DEST)\hpmonmgr.obj \
- $(DEST)\instview.obj \
- $(DEST)\main.obj \
- $(DEST)\objlist.obj \
- $(DEST)\objview.obj \
- $(DEST)\obsearch.obj \
- $(DEST)\refsview.obj \
- $(DEST)\utf8.obj \
- $(DEST)\utils.obj
-
-
- !if "$(CFG)" == "all"
-
- all:
- @echo ----------------------------------------------------------------
- @echo Building debug configuration...
- @nmake CFG=debug
- @echo ----------------------------------------------------------------
- @echo Building release configuration...
- @nmake CFG=release
-
- !else
-
- all: $(DEST)\$(BASE_NAME).dll
-
- $(DEST):
- @if not exist $(DEST)\nul mkdir $(DEST)
-
- $(DEST)\$(BASE_NAME).dll: $(DEST) $(OBJS) $(DEST)\$(BASE_NAME).def $(DEST)\$(BASE_NAME).res
- link /dll /nodefaultlib /def:$(DEST)\$(BASE_NAME).def /debug /pdb:$(DEST)\$(BASE_NAME).pdb /out:$@ $(OBJS) $(LIBS) $(DEST)\$(BASE_NAME).res
-
-
- $(OBJS): $(DEST)\heapmon.pch
-
- $(DEST)\heapmon.pch: pch.hpp pch.cpp
- cl -Yc -Fp$(DEST)\heapmon.pch $(CL_SWITCHES) /Fd$(DEST)\$(BASE_NAME).pdb /Fo$(DEST)\pch.obj /c pch.cpp
-
- .cpp{$(DEST)}.obj:
- @if not exist $(DEST)\nul mkdir $(DEST)
- cl -Yu -Fp$(DEST)\heapmon.pch $(CL_SWITCHES) /Fd$(DEST)\$(BASE_NAME).pdb /Fo$@ /c $<
-
- # no pch for guids.c
- $(DEST)\guids.obj: $(DEST) guids.c
- cl $(CL_SWITCHES) -W3 /Fd$(DEST)\$(BASE_NAME).pdb /Fo$@ /c guids.c
-
- $(DEST)\$(BASE_NAME).def: $(BASE_NAME).def
- cl -EP $(CL_SWITCHES) -Tc$(BASE_NAME).def > $@
-
- $(DEST)\$(BASE_NAME).res: $(BASE_NAME).rc
- rc $(DEFINES) -Fo$@ $(BASE_NAME).rc
-
-
- clean:
- @if exist debug\nul deltree /y debug
- @if exist release\nul deltree /y release
-
- !endif
-
-