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
|
include /usr/share/dpkg/architecture.mk
NAME = libutils
SOURCES = \
CallStack.cpp \
FileMap.cpp \
JenkinsHash.cpp \
Looper.cpp \
misc.cpp \
NativeHandle.cpp \
Printer.cpp \
ProcessCallStack.cpp \
PropertyMap.cpp \
RefBase.cpp \
SharedBuffer.cpp \
StopWatch.cpp \
String16.cpp \
String8.cpp \
StrongPointer.cpp \
SystemClock.cpp \
Threads.cpp \
Timers.cpp \
Tokenizer.cpp \
Unicode.cpp \
VectorImpl.cpp \
SOURCES := $(foreach source, $(SOURCES), libutils/$(source))
CXXFLAGS += -std=gnu++17
CPPFLAGS += \
-Iinclude \
-Ibase/include \
-Icutils/include \
-Ilibprocessgroup/include \
-DLIBUTILS_NATIVE=1 \
LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \
-Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \
-lpthread -L. -llog -lcutils -lbacktrace
# -latomic should be the last library specified
# https://github.com/android/ndk/issues/589
ifeq ($(DEB_HOST_ARCH), armel)
LDFLAGS += -latomic
endif
ifeq ($(DEB_HOST_ARCH), mipsel)
LDFLAGS += -latomic
endif
build: $(SOURCES)
$(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS)
ln -s $(NAME).so.0 $(NAME).so
clean:
$(RM) $(NAME).so*
|