rita | 3f2ca90 | 2023-06-16 13:36:53 +0800 | [diff] [blame] | 1 | SHELL = /bin/sh |
| 2 | RM = rm -f |
| 3 | |
| 4 | LOCAL_CFLAGS := -Wall \ |
| 5 | -std=gnu++14 \ |
| 6 | -g -Os \ |
| 7 | -flto \ |
| 8 | -fPIC \ |
| 9 | -DECALL_SUPPORT \ |
| 10 | -fpermissive \ |
| 11 | |
| 12 | |
rita | eba501e | 2023-11-27 16:49:43 +0800 | [diff] [blame] | 13 | ifeq ($(strip $(TARGET_PLATFORM)), T106) |
| 14 | LOCAL_CFLAGS += -DMOBILETEK_TARGET_PLATFORM_T106 |
| 15 | endif |
rita | 3f2ca90 | 2023-06-16 13:36:53 +0800 | [diff] [blame] | 16 | |
| 17 | $(warning ################# lynq qser sms demo ROOT: $(ROOT),includedir:$(includedir)) |
| 18 | LOCAL_PATH = . |
| 19 | |
| 20 | LOCAL_C_INCLUDES = \ |
| 21 | -I. \ |
| 22 | -I$(LOCAL_PATH)/include/ \ |
| 23 | -I$(ROOT)$(includedir)/logger \ |
| 24 | -I$(ROOT)$(includedir)/liblog \ |
rita | 2ecb128 | 2024-03-04 11:09:33 +0800 | [diff] [blame^] | 25 | -I$(ROOT)$(includedir)/libsim \ |
rita | 3f2ca90 | 2023-06-16 13:36:53 +0800 | [diff] [blame] | 26 | |
| 27 | LOCAL_LIBS := \ |
| 28 | -L. \ |
| 29 | -ldl \ |
| 30 | -lstdc++ \ |
| 31 | -lcutils \ |
| 32 | -lutils \ |
| 33 | -lpthread \ |
| 34 | -llynq-log \ |
| 35 | -llynq-sim \ |
| 36 | |
| 37 | |
| 38 | SOURCES = $(wildcard *.cpp) |
| 39 | |
| 40 | EXECUTABLE = liblynq-qser-sim.so |
| 41 | |
| 42 | OBJECTS=$(SOURCES:.cpp=.o) |
| 43 | |
| 44 | |
| 45 | .PHONY: build clean install pack_rootfs |
| 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 | install: |
| 56 | mkdir -p $(ROOT)$(base_libdir)/ |
| 57 | install $(EXECUTABLE) $(ROOT)$(base_libdir)/ |
| 58 | mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk |
| 59 | pack_rootfs: |
| 60 | mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/ |
| 61 | cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/ |
| 62 | $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE) |
| 63 | mkdir -p $(PACK_TO)$(base_libdir)/ |
| 64 | cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/ |
| 65 | $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE) |
| 66 | .PHONY: clean |
| 67 | clean: |
| 68 | $(RM) $(OBJECTS) $(EXECUTABLE) |
| 69 | -find . -name "*.o" -delete |