-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
108 lines (93 loc) · 2.54 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# vim: noexpandtab: tabstop=4: shiftwidth=4
# $Id$
# -------------------------------------------------------------------------
# This file is part of ZeroBugs, Copyright (c) 2010 Cristian L. Vlasceanu
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# -------------------------------------------------------------------------
SHELL:=/bin/bash
ifeq ($(TOP),)
TOP:=$(shell pwd)
endif
include $(TOP)/zdk/make/Common.mak
#
# Determine which disassembler plugin to use
#
DISASM=disasm
# Use the udis-based disassembler on intel-compatible platforms
# x86_64 or i686, use libudis-based disassembler.
# Use the generic disassembler on PowerPC
ifneq ($(ARCH),ppc)
DISASM=udis
endif
#
# Modules to build (including the engine)
#
ifeq ($(RELEASE),)
auto=
else
auto=$(PLUGIN_PATH)autotest
endif
gui=$(PLUGIN_PATH)gui
dwarf=$(PLUGIN_PATH)dwarf
stabs=$(PLUGIN_PATH)stabs
disasm=$(PLUGIN_PATH)$(DISASM)
demangle_d=$(PLUGIN_PATH)libdemangle_d.so
server=server
remote=$(PLUGIN_PATH)remote-proxy
zdb=zdb
cache=$(PLUGIN_PATH)cache
#
# detect boost_python; todo: use AX_BOOST_PYTHON
#
ifneq ($(shell ls /usr/include/boost/python 2>/dev/null),)
python=$(PLUGIN_PATH)python
else
ifneq ($(shell ls /usr/local/lib/libboost_python.* 2>/dev/null),)
python=$(PLUGIN_PATH)python
endif
endif
modules=engine \
$(disasm) \
$(dwarf) \
$(stabs) \
$(python) \
$(gui) \
$(server) \
$(remote) \
$(auto)
modules:
for m in $(modules); do (cd $$m; $(MAKE) $(PARALLEL); ) done
all: which_disasm modules $(demangle_d)
which_disasm: .PHONY
@echo disassembler="$(DISASM)"
$(demangle_d): .PHONY
cd demangle_d; $(MAKE)
preclean:
rm -rf $(LIB_PATH) $(BIN_PATH) gcc_ver
rm -f .zero.config
rm -rf .zero *.zero report.html
rm -rf tools/$(ARCH)__*
rm -rf autom4te.cache config.status config.log build.log
find . -name "*.pyc" -exec rm {} \;
clean: preclean libclean
$(foreach mod, $(modules) engine/testsuite demangle_d, pushd $(mod); $(MAKE) clean; popd;)
rm -f gcc_ver
tidy: clean
find . -name "*.make" -exec rm {} \;
find . -name depend.stamp -exec rm {} \;
rm -f libs_used.txt
depend:
$(foreach mod, $(modules), pushd $(mod); $(MAKE) depend; popd;)
@if test -f $(LIB_LIST); then :; else echo "Did you forget to make tidy?"; exit 1; fi
sort -u $(LIB_LIST) > tmp && mv tmp $(LIB_LIST)
install: all
make/install.sh
# Archive up the source tree
TARFILE=zero.$(shell date +%m%d%y).tar.bz2
THIS_DIR=$(notdir $(TOP))
tar: tidy
echo $(THIS_DIR)
cd $(TOP)/..; tar jvcf $(TARFILE) $(THIS_DIR)