asuswrt-merlin.ng/release/src-rt-5.02axhnd.675x/router-sysdep.rt-ax58u/sys_util/Makefile
Eric Sauvageau faefc269c3 SDK-6750: move RT-AX58U router-sysdep to model-specific folder, and copy appropriate model content to router-sysdep at build time
Symlinking doesn't work due to some shell tricks used in Makefiles
to extract info out of the current work directory.
2020-08-29 00:34:09 -04:00

40 lines
1.2 KiB
Makefile

LIB := libsys_util.so
OBJS := thread_id.o proc.o sysutil_fs.o
CFLAGS += -Werror -Wfatal-errors -I$(HND_SRC)/userspace/public/include/linux/ -I$(HND_SRC)/userspace/public/include/
# These are public API headers needed by other apps which want to call this lib.
# Private/internal headers should not be listed here.
HEADERS := sysutil.h sysutil_proc.h sysutil_fs.h
all: $(LIB)
LIB_INSTALL_DIR := $(BCM_FSBUILD_DIR)/public/lib
HEADER_INSTALL_DIR := $(BCM_FSBUILD_DIR)/public/include
install: $(LIB)
mkdir -p $(LIB_INSTALL_DIR)
install -t $(LIB_INSTALL_DIR) $(LIB)
mkdir -p $(INSTALLDIR)/lib
install -t $(INSTALLDIR)/lib $(LIB)
mkdir -p $(HEADER_INSTALL_DIR)
install -p -m 444 -t $(HEADER_INSTALL_DIR) $(addprefix $(mdir)/,$(HEADERS))
clean:
rm -f *.o *.d $(LIB)
rm -f $(LIB_INSTALL_DIR)/$(LIB)
rm -f $(addprefix $(HEADER_INSTALL_DIR)/,$(HEADERS))
$(LIB): $(OBJS)
$(CC) -shared $(BCM_LD_FLAGS) -Wl,--whole-archive,-soname,$(notdir $@) -o $@ $(OBJS) -Wl,--no-whole-archive
# Set VPATH because we want to compile in a seperate dir than source.
name := $(lastword $(MAKEFILE_LIST))
mdir := $(realpath $(dir $(name)))
VPATH=$(mdir)
# Generate and use dependencies.
CFLAGS += -MD
-include $(OBJS:%.o=%.d)