-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·81 lines (61 loc) · 4.2 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
CXX=g++-5
SRC=./src
BIN=./bin
BUILD=./build
TEST=./test
CXX_FLAG=-g -Wl,--no-as-needed -lz -I$(SRC)/dex/ -I$(SRC)/apk/ -I$(SRC)/common/ -I$(SRC)/res/ -std=c++11 -Wall -Wextra
OPT_FLAG=
CXX_FLAG+=$(OPT_FLAG)
all: apk_test xml_test buffer_test res_table_test encoding_test dex_test
$(BIN)/apk_test: $(BUILD)/apk.o $(TEST)/apk_test.cpp $(TEST)/test_suite.h $(BUILD)/test_suite.o $(BUILD)/common.o $(BUILD)/res_base.o
g++ $(CXX_FLAG) $(BUILD)/test_suite.o $(BUILD)/apk.o $(TEST)/apk_test.cpp $(BUILD)/common.o $(BUILD)/res_base.o -o $(BIN)/apk_test
ln -sf $(BIN)/apk_test ./apk_test-bin
$(BIN)/xml_test: $(BUILD)/xml.o $(TEST)/xml_test.cpp $(BUILD)/test_suite.o $(BUILD)/common.o $(BUILD)/res_base.o $(BUILD)/res_table.o $(BUILD)/package_group.o
g++ $(CXX_FLAG) $(BUILD)/test_suite.o $(TEST)/xml_test.cpp $(BUILD)/common.o $(BUILD)/res_base.o $(BUILD)/res_table.o $(BUILD)/package_group.o $(BUILD)/xml.o -o $(BIN)/xml_test
ln -sf $(BIN)/xml_test ./xml_test-bin
$(BIN)/buffer_test: $(TEST)/buffer_test.cpp $(TEST)/test_suite.h $(BUILD)/test_suite.o $(BUILD)/common.o
g++ $(CXX_FLAG) $(BUILD)/test_suite.o $(TEST)/buffer_test.cpp $(BUILD)/common.o -o $(BIN)/buffer_test
ln -sf $(BIN)/buffer_test ./buffer_test-bin
$(BIN)/encoding_test: $(TEST)/encoding_test.cpp $(TEST)/test_suite.h $(BUILD)/test_suite.o $(BUILD)/common.o
g++ $(CXX_FLAG) $(BUILD)/test_suite.o $(TEST)/encoding_test.cpp $(BUILD)/common.o -o $(BIN)/encoding_test
ln -sf $(BIN)/encoding_test ./encoding_test-bin
$(BIN)/res_table_test: $(TEST)/res_table_test.cpp $(BUILD)/test_suite.o $(BUILD)/common.o $(BUILD)/res_table.o $(BUILD)/res_base.o $(BUILD)/package_group.o $(BUILD)/xml.o
g++ $(CXX_FLAG) $(BUILD)/test_suite.o $(TEST)/res_table_test.cpp $(BUILD)/common.o $(BUILD)/res_base.o $(BUILD)/res_table.o $(BUILD)/package_group.o $(BUILD)/xml.o -o $(BIN)/res_table_test
ln -sf $(BIN)/res_table_test ./res_table_test-bin
$(BIN)/dex_test: $(TEST)/dex_test.cpp $(TEST)/test_suite.h $(BUILD)/test_suite.o $(BUILD)/dex.o $(BUILD)/inst.o
g++ $(CXX_FLAG) $(BUILD)/test_suite.o $(TEST)/dex_test.cpp $(BUILD)/common.o $(BUILD)/dex.o $(BUILD)/inst_format.o $(BUILD)/inst.o -o $(BIN)/dex_test
ln -sf $(BIN)/dex_test ./dex_test-bin
apk_test: $(BIN)/apk_test
xml_test: $(BIN)/xml_test
buffer_test: $(BIN)/buffer_test
encoding_test: $(BIN)/encoding_test
res_table_test: $(BIN)/res_table_test
dex_test: $(BIN)/dex_test
$(BUILD)/common.o: $(SRC)/common/common.cpp $(SRC)/common/common.h $(SRC)/common/utf.h $(SRC)/common/buffer.h
g++ -c $(CXX_FLAG) $(SRC)/common/common.cpp -o $(BUILD)/common.o
$(BUILD)/test_suite.o: $(TEST)/test_suite.cpp $(TEST)/test_suite.h $(BUILD)/common.o
g++ -c $(CXX_FLAG) $(TEST)/test_suite.cpp -o $(BUILD)/test_suite.o
$(BUILD)/apk.o: $(SRC)/apk/apk.cpp $(SRC)/apk/apk.h $(BUILD)/common.o
g++ -c $(CXX_FLAG) $(SRC)/apk/apk.cpp -o $(BUILD)/apk.o
$(BUILD)/xml.o: $(SRC)/res/xml.cpp $(SRC)/res/xml.h $(SRC)/res/res_base.h $(BUILD)/common.o
g++ -c $(CXX_FLAG) $(SRC)/res/xml.cpp -o $(BUILD)/xml.o
$(BUILD)/res_table.o: $(SRC)/res/res_table.cpp $(SRC)/res/res_table.h $(SRC)/res/res_base.h $(SRC)/res/res_value.h $(SRC)/res/type_config.h $(BUILD)/common.o
g++ -c $(CXX_FLAG) $(SRC)/res/res_table.cpp -o $(BUILD)/res_table.o
$(BUILD)/package_group.o: $(SRC)/res/package_group.cpp $(SRC)/res/package_group.h $(BUILD)/common.o
g++ -c $(CXX_FLAG) $(SRC)/res/package_group.cpp -o $(BUILD)/package_group.o
$(BUILD)/res_base.o: $(SRC)/res/res_base.cpp $(SRC)/res/res_base.h $(SRC)/res/res_value.h $(SRC)/res/type_config.h $(BUILD)/common.o
g++ -c $(CXX_FLAG) $(SRC)/res/res_base.cpp -o $(BUILD)/res_base.o
$(BUILD)/dex.o: $(SRC)/dex/dex.h $(SRC)/dex/dex.cpp $(SRC)/dex/dex_common.h $(BUILD)/common.o
g++ -c $(CXX_FLAG) $(SRC)/dex/dex.cpp -o $(BUILD)/dex.o
$(BUILD)/inst_format.o: $(SRC)/dex/inst_format.h $(SRC)/dex/inst_format.cpp $(BUILD)/common.o $(SRC)/dex/inst_format.py
cd ./src/dex && python inst_format.py && unix2dos ./inst_format.h ./inst_format.cpp && cd ../../
g++ -c $(CXX_FLAG) $(SRC)/dex/inst_format.cpp -o $(BUILD)/inst_format.o
$(BUILD)/inst.o: $(SRC)/dex/inst.h $(SRC)/dex/inst.cpp $(BUILD)/common.o $(BUILD)/inst_format.o
g++ -c $(CXX_FLAG) $(SRC)/dex/inst.cpp -o $(BUILD)/inst.o
prepare:
mkdir -p bin
mkdir -p build
mkdir -o run_test
clean:
rm -f ./build/*
rm -f ./bin/*