-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathMakefile.w32
executable file
·78 lines (65 loc) · 2.77 KB
/
Makefile.w32
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
70
71
72
73
74
75
76
77
78
# makefile for gnu/cygwin make, using msvc compiler,
# needs environment setup with 'vcvars32.bat' ( from vstudio )
#
# author: Willem Hengeveld <itsme@xs4all.nl>
# web: http://www.xs4all.nl/~itsme/projects/disassemblers/ida/idp-Makefile
#
CXX=cl.exe
LD=link.exe
.SUFFIXES:
.SUFFIXES: .cpp .obj .plw
# microsoft's headers are loaded with warnings:
#C4514: 'uint128::uint128' : unreferenced inline function has been removed
#C4710: function 'int __stdcall getreg(unsigned long,int)' not inlined
#C4244: '+=' : conversion from 'int' to 'unsigned short', possible loss of data
#C4242: '=' : conversion from 'int' to 'ushort', possible loss of data
#C4127: conditional expression is constant
#C4146: unary minus operator applied to unsigned type, result still unsigned
#C4820: '__stat64' : '4' bytes padding added after member '__stat64::st_rdev'
#C4217: member template functions cannot be used for copy-assignment or copy-construction
#C4668: '_MT' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
#C4619: #pragma warning : there is no warning number '4284'
#C4511: copy constructor could not be generated
#C4512: assignment operator could not generated
#C4201: nonstandard extension used : nameless struct/union
# disabling them all, to get a more readable compiler output.
NOWARN=-wd4619 -wd4514 -wd4710 -wd4244 -wd4242 -wd4127 -wd4668 -wd4146 -wd4820 -wd4217 -wd4511 -wd4512 -wd4201
CDEFS=-DWIN32 -D_USRDLL -D__NT__ -D__IDP__ -DMAXSTR=1024
# for vs2005:
CDEFS+=-D_SCL_SECURE_NO_WARNINGS -D_SECURE_SCL=0 -D_CRT_SECURE_NO_WARNINGS
CINCS=-I $(idasdk)/include -I c:/local/boost_1_74_0
CINCS+=-I "$(vc)/include" -I "$(vc)/platformsdk/include"
COPTS=-EHsc -GR -Gz -nologo
COPTS+=-utf-8
LDLIBS=-libpath:$(idasdk)/lib/x64_win_vc_32 ida.lib
LDFLAGS=-nologo -dll -export:PLUGIN
DEBUG=yes
ifeq ($(DEBUG),yes)
LDFLAGS+=-debug
COPTS+=-Zi
else
COPTS+=-O2
endif
# msvc 12.00 does not support -Wall yet -> use -W4.
# msvc 13.10 does support it.
#
%.obj: %.cpp
@"$(CXX)" -c -W4 $(NOWARN) $(COPTS) $(CINCS) $(CDEFS) -Fo$@ $<
all: dbdump.plw
dbdump.plw: pluginreg.obj dumper.obj
@"$(LD)" $(LDFLAGS) $(LDLIBS) $^ /out:$@ /map:dbdump.map
pluginreg.obj: pluginreg.cpp
dumper.obj: dumper.cpp
clean:
-$(RM) $(wildcard *.lib *.exp *.obj *.exe *.dll *.plw *.pdb *.ilk *.map)
install: dbdump.plw
@cp dbdump.plw $(idasdk)/../plugins
@if ! grep -qw dbdump $(subst \,/,$(idasdk))/../plugins/plugins.cfg; then \
echo "" >>$(subst \,/,$(idasdk))/../plugins/plugins.cfg ; \
echo "DumpIDC dbdump Alt-2 0" >>$(subst \,/,$(idasdk))/../plugins/plugins.cfg ; \
echo "DumpNodes dbdump Alt-3 1" >>$(subst \,/,$(idasdk))/../plugins/plugins.cfg ; \
fi
test: install
$(idasdk)/../idag.exe testcode/winhello.idb
zip:
zip ida-dbdump.zip dumper.h dumper.cpp Makefile pluginreg.cpp README.txt