forked from gsmk/hexagon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.w32
66 lines (44 loc) · 1.97 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
include ../idacfg.mk
all:
#vc=c:/Program Files/Microsoft Visual Studio 8/VC
#winsdk=$(vc)/platformsdk
vc=c:/Program Files (x86)/Microsoft Visual Studio 14.0/VC
winsdk=C:/Program Files (x86)/Windows Kits/10
CXX=$(vc)/bin/cl.exe
CC=$(vc)/bin/cl.exe
LD=$(vc)/bin/link.exe
TARGETS+=hexagon.w32
# where the quicinc objdump source can be found
gnutools= hx/sourceryg++-2012.03-151-hexagon/binutils-hexagon-2012.03
gnutoolsincludes=-I $(gnutools)/include -I $(gnutools)/bfd -I $(gnutools)/include/opcode
gnutoolsincludes+=-I build-win/opcodes -I build-win/bfd
CFLAGS=-EHsc -GR -Gz -nologo -Zi -D__NT__ -D__IDP__ -I $(idasdk)/include -I $(BOOST)
CFLAGS+=-I "$(vc)/include" -I "$(winsdk)/include" -D_WIN32 -DWIN32 -D_USRDLL -DMAXSTR=1024
CFLAGS+=-O2
LDLIBS=$(idasdk)/lib/x86_win_vc_32/ida.lib
LDLIBS+=-libpath:"$(vc)/lib" -libpath:"$(winsdk)/lib"
LDFLAGS=-debug -nologo -dll -export:LPH -stub:$(idasdk)/module/stub
# add this flag when you want verbose logging
#CFLAGS+=-DTRACELOG
all: $(TARGETS)
hexagon.w32: hexagon.obj gt_safe-ctype.obj gt_hexagon-dis.obj gt_hexagon-opc.obj bfd_funcs.obj gt_hexagon-isa.obj gt_cpu-hexagon.obj dummy-scan.obj
cflags_hexagon= $(gnutoolsincludes)
cflags_bfd_funcs= $(gnutoolsincludes)
install: hexagon.w32
cp $^ "$(idabin)/procs"
clean:
$(RM) $(TARGETS) $(wildcard *.obj) $(GENERATEDFILES) hexagon.exp hexagon.ilk hexagon.lib hexagon.pdb vc140.pdb
%.obj: %.cpp
"$(CXX)" -c -Fo$@ $^ $(cflags_$(basename $(notdir $@))) $(CFLAGS) $(CXXFLAGS)
%.obj: %.c
"$(CC)" -c -Fo$@ $^ $(cflags_$(basename $(notdir $@))) $(CFLAGS)
gt_%.obj: $(gnutools)/libiberty/%.c
"$(CC)" -c -Fo$@ $^ $(cflags_$(basename $(notdir $@))) $(gnutoolsincludes) $(CFLAGS)
gt_%.obj: $(gnutools)/opcodes/%.c
"$(CC)" -c -Fo$@ $^ $(cflags_$(basename $(notdir $@))) $(gnutoolsincludes) $(CFLAGS)
gt_%.obj: $(gnutools)/bfd/%.c
"$(CC)" -c -Fo$@ $^ $(cflags_$(basename $(notdir $@))) $(gnutoolsincludes) $(CFLAGS)
%.obj: %.s
"$(CXX)" -c -Fo$@ $^
%.w32: %.obj
"$(LD)" $(LDFLAGS) -out:$@ $^ $(LDLIBS)