This repository has been archived by the owner on Aug 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
/
Makefile
69 lines (58 loc) · 1.61 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
LD=link
MAKE=nmake
RM=DEL
CP=COPY
!IFDEF PLATFORM
PLAT=$(PLATFORM)
!ELSEIFDEF TARGET_CPU
PLAT=$(TARGET_CPU)
!ELSE
!ERROR Target platform cannot be deduced. Make sure the MS SDK building \
environment is set.
!ENDIF
!IF "$(PLAT)"=="x86"
PLAT_ALT=i386
!ELSEIF "$(PLAT)"=="x64"
PLAT_ALT=amd64
!ENDIF
!IF EXIST("$(WINDOWSSDKDIR)\Debuggers")
WINDBG_DIR=$(WINDOWSSDKDIR)\Debuggers
WINDBGSDK_INC=$(WINDBG_DIR)\inc
WINDBGSDK_LIB=$(WINDBG_DIR)\lib\$(PLAT)
WINDBG_EXT=$(WINDBG_DIR)\$(PLAT)\winext
!ELSEIF EXIST("$(PROGRAMFILES)\Debugging Tools for Windows ($(PLAT))")
WINDBG_DIR=$(PROGRAMFILES)\Debugging Tools for Windows ($(PLAT))
WINDBGSDK_INC=$(WINDBG_DIR)\sdk\inc
WINDBGSDK_LIB=$(WINDBG_DIR)\sdk\lib\$(PLAT_ALT)
WINDBG_EXT=$(WINDBG_DIR)\winext
!ELSEIF EXIST("$(PROGRAMFILES) (x86)\Debugging Tools for Windows ($(PLAT))")
WINDBG_DIR=$(PROGRAMFILES) (x86)\Debugging Tools for Windows ($(PLAT))
WINDBGSDK_INC=$(WINDBG_DIR)\sdk\inc
WINDBGSDK_LIB=$(WINDBG_DIR)\sdk\lib\$(PLAT_ALT)
WINDBG_EXT=$(WINDBG_DIR)\winext
!ELSE
!ERROR Cannot find WinDbg installation directory.
!ENDIF
CPPFLAGS_CMN=-I"$(WINDBGSDK_INC)"
CPPFLAGS=$(CPPFLAGS_CMN) -Yucommon.h
LDFLAGS=-DLL -LIBPATH:"$(WINDBGSDK_LIB)" dbgeng.lib
OBJS = rdflags.obj \
common.obj \
config.obj \
pebase.obj \
resrc.obj \
imports.obj \
except.obj \
dumpext.obj
all: dumpext.dll
clean:
$(RM) *.obj *.dll *.exp *.lib
distclean: clean
$(RM) *.pch
install: dumpext.dll
$(CP) $** "$(WINDBG_EXT)"
# precompiled common headers
common.obj: common.cpp
$(CPP) -c $(CPPFLAGS_CMN) -Yc$*.h $**
dumpext.dll: $(OBJS)
$(LD) -DEF:dumpext.def $(LDFLAGS) $** /out:$@