| SHELL = /bin/sh |
| RM = rm -f |
| |
| LOCAL_CFLAGS := -Wall \ |
| -g -Os \ |
| -flto \ |
| -fPIC |
| |
| PWD := $(shell pwd) |
| |
| $(warning ################# lynq shm ROOT: $(ROOT),includedir:$(includedir), PWD :$(PWD)) |
| LOCAL_PATH = . |
| |
| LOCAL_C_INCLUDES = \ |
| -I. \ |
| -I$(LOCAL_PATH)/include \ |
| -I$(ROOT)$(includedir) \ |
| |
| LOCAL_LIBS := \ |
| -L. \ |
| -ldl \ |
| -llog \ |
| # -lbinder \ |
| -lpthread \ |
| # -lutils \ |
| # -lcutils \ |
| |
| SOURCES = $(wildcard *.cpp) |
| |
| EXECUTABLE = liblynq-shm.so |
| |
| OBJECTS=$(SOURCES:.c=.o) |
| all: $(EXECUTABLE) |
| |
| $(EXECUTABLE): $(OBJECTS) |
| $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@ |
| |
| %.o : %.c |
| $(CC) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $< |
| |
| build: $(EXECUTABLE) |
| $(warning ########## build $(EXECUTABLE) ##########) |
| |
| install: |
| $(warning ################# lynq shm EXECUTABLE: $(EXECUTABLE),base:$(base_libdir)) |
| mkdir -p $(ROOT)$(base_libdir)/ |
| install $(EXECUTABLE) $(ROOT)$(base_libdir)/ |
| |
| pack_rootfs: |
| $(warning ################# lynq shm PACK: $(PACK_INITRAMFS_TO),base:$(base_libdir)) |
| mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/ |
| cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/ |
| $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE) |
| mkdir -p $(PACK_TO)$(base_libdir)/ |
| cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/ |
| $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE) |
| |
| .PHONY: clean |
| clean: |
| $(RM) $(OBJECTS) $(EXECUTABLE) |
| |
| |