forked from gsmk/hexagon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.linux
67 lines (46 loc) · 1.83 KB
/
Makefile.linux
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
include ../idacfg.mk
all:
# I put some not yet published targets in this optional include
-include Makefile.extra
CXX=clang++
CC=clang
LD=clang++
TARGETS+=hexagon.ilx
# 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-mac/opcodes -I ./build-mac/bfd
CFLAGS=-g -D__MAC__ -D__IDP__ -I $(idasdk)/include
CFLAGS+=-DUSE_STANDARD_FILE_FUNCTIONS
CFLAGS+=-DUSE_DANGEROUS_FUNCTIONS
CFLAGS+=-D_FORTIFY_SOURCE=0
CFLAGS+=-O0 -g -fpic
# add this flag when you want verbose logging
#CFLAGS+=-DTRACELOG
all: $(TARGETS)
hexagon.ilx: hexagon.o32 gt_safe-ctype.o32 gt_hexagon-dis.o32 gt_hexagon-opc.o32 gt_hexagon-isa.o32 bfd_funcs.o32 gt_cpu-hexagon.o32 dummy-scan.o32
cflags_cpu-hexagon= $(gnutoolsincludes)
cflags_hexagon= $(gnutoolsincludes)
cflags_bfd_funcs= $(gnutoolsincludes)
install: hexagon.ilx
cp $^ "$(idabin)/procs"
clean:
$(RM) $(TARGETS) $(wildcard *.o) $(wildcard *.o32)
%.o32: %.cpp
$(CXX) -m32 -std=c++11 -c -o$@ $^ $(cflags_$(basename $(notdir $@))) $(CFLAGS)
%.o32: %.c
$(CC) -m32 -c -o$@ $^ $(cflags_$(basename $(notdir $@))) $(CFLAGS)
gt_%.o32: $(gnutools)/libiberty/%.c
$(CC) -m32 -c -o$@ $^ $(cflags_$(basename $(notdir $@))) $(gnutoolsincludes) $(CFLAGS)
gt_%.o32: $(gnutools)/opcodes/%.c
$(CC) -m32 -c -Wstrict-prototypes -Wmissing-prototypes -o$@ $^ $(cflags_$(basename $(notdir $@))) $(gnutoolsincludes) $(CFLAGS)
gt_%.o32: $(gnutools)/bfd/%.c
$(CC) -m32 -c -Wstrict-prototypes -Wmissing-prototypes -o$@ $^ $(cflags_$(basename $(notdir $@))) $(gnutoolsincludes) $(CFLAGS)
%.o32: %.s
$(CXX) -c -m32 -o$@ $^
%.ilx: %.o32
$(LD) -shared -m32 -o $@ $^ "$(idabin)/libida.so"
%: %.o
$(CXX) -g -o $@ $^
%32: %.o32
$(CXX) -m32 -g -o $@ $^