forked from nlitsme/idbutil
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
executable file
·44 lines (32 loc) · 1.16 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
# either specify `idasdk` and `idabin` in this config file,
# or pass them as variables on the make commandline.
-include ../idacfg.mk
space=$(empty) $(empty)
escapespaces=$(subst $(space),\ ,$1)
fileexists=$(wildcard $(call escapespaces,$1))
ifeq ($(call fileexists,$(idasdk)/include/ida.hpp),)
$(error The `idasdk` variable does not point to a directory containing an include directory with the ida headers.)
endif
ifeq ($(call fileexists,$(idabin)/libida.dylib),)
$(error The `idabin` variable does not point to a directory containing the ida binaries.)
endif
APPS=idbtool unittests
all: $(APPS)
clean:
$(RM) $(APPS) $(wildcard *.o)
CXX=clang++
unittests: unittests.o
idbtool: idbtool.o
ldflags_idbtool=-lz -L/usr/local/lib -lgmp
CFLAGS=-std=c++1z -fPIC $(if $(D),-O0,-O3) -g -Wall -I /usr/local/include -I cpputils -I $(idasdk)/include/ -D__MAC__
CFLAGS+=-DUSE_STANDARD_FILE_FUNCTIONS
CFLAGS+=-DUSE_DANGEROUS_FUNCTIONS
LDFLAGS=-g -Wall
%.o: %.cpp
$(CXX) -c $^ -o $@ $(cflags_$(basename $(notdir $@))) $(CFLAGS)
%: %.o
$(CXX) $^ -o $@ $(ldflags_$(basename $(notdir $@))) $(LDFLAGS)
install:
cp idbtool ~/bin/
pull:
git submodule update --recursive --remote