ll | bd9cc17 | 2022-12-30 16:36:18 +0800 | [diff] [blame] | 1 |
|
| 2 | SHELL = /bin/sh
|
| 3 | RM = rm -f
|
| 4 |
|
| 5 | LOCAL_CFLAGS := -Wall \
|
| 6 | -std=gnu++14 \
|
| 7 | -g -Os \
|
| 8 | -flto \
|
| 9 | -DRIL_SHLIB \
|
| 10 | -DATCI_PARSE \
|
| 11 | -fPIC \
|
| 12 | -DKEEP_ALIVE \
|
| 13 | -DECALL_SUPPORT \
|
| 14 | -fpermissive \
|
| 15 |
|
| 16 | $(warning ################# lynq at factory demo ROOT: $(ROOT),includedir:$(includedir))
|
| 17 | LOCAL_PATH = .
|
| 18 |
|
| 19 | LOCAL_C_INCLUDES = \
|
| 20 | -I. \
|
| 21 | -I$(LOCAL_PATH)/include/libat \
|
| 22 | -I$(ROOT)$(includedir)/logger \
|
| 23 | -I$(ROOT)$(includedir)/liblog \
|
| 24 | -I$(ROOT)$(includedir)/vendor-ril \
|
| 25 |
|
| 26 |
|
| 27 | LOCAL_LIBS := \
|
| 28 | -L. \
|
| 29 | -ldl \
|
| 30 | -lstdc++ \
|
| 31 | -llog \
|
| 32 | -lcutils \
|
| 33 | -lutils \
|
| 34 | -lbinder \
|
| 35 | -lpthread \
|
| 36 |
|
| 37 |
|
| 38 | SOURCES = $(wildcard *.cpp)
|
| 39 |
|
| 40 | EXECUTABLE = liblynq-at-common.so
|
| 41 |
|
| 42 | OBJECTS=$(SOURCES:.cpp=.o)
|
| 43 |
|
| 44 | .PHONY: build clean install pack_rootfs
|
| 45 |
|
| 46 | all: build
|
| 47 | $(EXECUTABLE): $(OBJECTS)
|
| 48 | $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
|
| 49 |
|
| 50 | %.o : %.cpp
|
| 51 | $(CXX) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
|
| 52 |
|
| 53 | build: $(EXECUTABLE)
|
| 54 | $(warning ########## build $(EXECUTABLE) ##########)
|
| 55 |
|
| 56 | install:
|
| 57 | mkdir -p $(ROOT)$(base_libdir)/
|
| 58 | install $(EXECUTABLE) $(ROOT)$(base_libdir)/
|
| 59 | mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
|
| 60 |
|
| 61 | pack_rootfs:
|
| 62 | mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/
|
| 63 | cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/
|
| 64 | $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)
|
| 65 | mkdir -p $(PACK_TO)$(base_libdir)/
|
| 66 | cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/
|
| 67 | $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)
|
| 68 |
|
| 69 | .PHONY: clean
|
| 70 | clean:
|
| 71 | $(RM) $(OBJECTS) $(EXECUTABLE)
|
| 72 | -find . -name "*.o" -delete
|