| 1 |
include /usr/share/dpkg/architecture.mk |
| 2 |
|
| 3 |
NAME = aapt2_test |
| 4 |
|
| 5 |
|
| 6 |
SOURCES = \ |
| 7 |
test/Builders.cpp \ |
| 8 |
test/Common.cpp \ |
| 9 |
test/Fixture.cpp \ |
| 10 |
|
| 11 |
SOURCES := $(foreach source, $(SOURCES), tools/aapt2/$(source)) |
| 12 |
SOURCES += $(foreach source, $(SOURCES), $(wildcard tools/aapt2/*_test.cpp)) |
| 13 |
SOURCES += $(foreach source, $(SOURCES), $(wildcard tools/aapt2/*/*_test.cpp)) |
| 14 |
|
| 15 |
|
| 16 |
ifeq (, $(shell which wget)) |
| 17 |
SOURCES := $(filter-out tools/aapt2/cmd/Compile_test.cpp tools/aapt2/cmd/Convert_test.cpp tools/aapt2/cmd/Link_test.cpp tools/aapt2/process/SymbolTable_test.cpp,$(SOURCES)) |
| 18 |
endif |
| 19 |
OBJECTS = $(SOURCES:.cpp=.o) |
| 20 |
|
| 21 |
CXXFLAGS += -std=gnu++17 \ |
| 22 |
-fno-rtti \ |
| 23 |
|
| 24 |
CPPFLAGS += \ |
| 25 |
-Idebian/out/proto/frameworks/base/tools/aapt2 \ |
| 26 |
-Ilibs/androidfw/include \ |
| 27 |
-Itools/aapt2 \ |
| 28 |
-Wno-unused-parameter \ |
| 29 |
-Wno-missing-field-initializers \ |
| 30 |
|
| 31 |
LDFLAGS += \ |
| 32 |
-Ldebian/out \ |
| 33 |
-L/usr/lib/$(DEB_HOST_MULTIARCH)/android \ |
| 34 |
-Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ |
| 35 |
-laapt2 \ |
| 36 |
-landroidfw \ |
| 37 |
-lbase \ |
| 38 |
-lgmock \ |
| 39 |
-lgtest \ |
| 40 |
-lgtest_main \ |
| 41 |
-lprotobuf \ |
| 42 |
-lutils \ |
| 43 |
-lziparchive \ |
| 44 |
-pie |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
ifneq ($(filter armel mipsel,$(DEB_HOST_ARCH)),) |
| 49 |
LDFLAGS += -latomic |
| 50 |
endif |
| 51 |
|
| 52 |
build: $(OBJECTS) |
| 53 |
$(CXX) $^ -o debian/out/$(NAME) $(LDFLAGS) |
| 54 |
|
| 55 |
$(OBJECTS): %.o: %.cpp |
| 56 |
$(CXX) -c -o $@ $< $(CXXFLAGS) $(CPPFLAGS) |