blob: e7a3ca872263fb67d1ddb79655c377f4cd3541a2 [file] [log] [blame]
SHELL = /bin/sh
RM = rm -f
LOCAL_CFLAGS := -Wall \
-Os \
-flto \
-fpermissive \
CFLAGS += -fPIC -O2 $(INCLUDE) -D_LARGEFILE64_SOURCE
$(warning ################# rock ROOT: $(ROOT),includedir:$(includedir))
LOCAL_PATH = .
LOCAL_C_INCLUDES = \
-I. \
-I./include \
-I$(LOCAL_PATH)/include \
-I$(ROOT)$(includedir)/glib-2.0 \
-I$(ROOT)$(libdir)/glib-2.0/include \
LOCAL_LIBS := \
-L. \
-L./lib \
-llog \
-lpthread \
-lwpa_client
SOURCES = $(wildcard *.c wildcard *.h )
EXECUTABLE = liblynq-wifi6.so
OBJECTS=$(SOURCES:.c=.o)
.PHONY: build clean install pack_rootfs
all: build
$(EXECUTABLE): $(OBJECTS)
$(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(CFLAGS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
%.o : %.c
$(CC) $(LOCAL_C_INCLUDES) $(CFLAGS) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
build: $(EXECUTABLE)
$(warning ########## build $(EXECUTABLE) ##########)
install:
mkdir -p $(ROOT)$(base_libdir)/
install $(EXECUTABLE) $(ROOT)$(base_libdir)/
mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
pack_rootfs:
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)