mirror of
https://github.com/gnuton/asuswrt-merlin.ng.git
synced 2025-05-19 16:02:36 +02:00
Symlinking doesn't work due to some shell tricks used in Makefiles to extract info out of the current work directory.
50 lines
1.4 KiB
Makefile
50 lines
1.4 KiB
Makefile
LIB := libbcm_boardctl.so
|
|
|
|
default: all
|
|
|
|
|
|
CURR_DIR := $(shell pwd)
|
|
BUILD_DIR:=$(subst /userspace, /userspace,$(CURR_DIR))
|
|
BUILD_DIR:=$(word 1, $(BUILD_DIR))
|
|
include $(BUILD_DIR)/make.common
|
|
|
|
|
|
ARCH=$(PROFILE_ARCH)
|
|
LIB_INSTALL_DIR := $(BCM_FSBUILD_DIR)/public/lib
|
|
HEADER_INSTALL_DIR := $(BCM_FSBUILD_DIR)/public/include
|
|
ALLOWED_INCLUDE_PATHS := -I . \
|
|
-I$(BUILD_DIR)/userspace/public/include \
|
|
-I$(BUILD_DIR)/userspace/public/include/$(OALDIR) \
|
|
-I$(BCM_FSBUILD_DIR)/public/include \
|
|
-I$(INC_BRCMSHARED_PUB_PATH)/$(BRCM_BOARD) \
|
|
-I$(INC_BRCMDRIVER_PUB_PATH)/$(BRCM_BOARD)
|
|
|
|
export ARCH CFLAGS LIB_INSTALL_DIR HEADER_INSTALL_DIR BUILD_DIR
|
|
|
|
|
|
# Final location of LIB for system image. Only the BRCM build system needs to
|
|
# know about this.
|
|
FINAL_LIB_INSTALL_DIR := $(INSTALL_DIR)/lib$(BCM_INSTALL_SUFFIX_DIR)
|
|
|
|
|
|
all install: clean_legacy
|
|
mkdir -p objs
|
|
$(MAKE) -C objs -f ../Makefile install
|
|
mkdir -p $(FINAL_LIB_INSTALL_DIR)
|
|
cp -p $(LIB_INSTALL_DIR)/$(LIB) $(FINAL_LIB_INSTALL_DIR)
|
|
|
|
clean: clean_legacy
|
|
rm -f $(FINAL_LIB_INSTALL_DIR)/$(LIB)
|
|
-mkdir -p objs
|
|
-$(MAKE) -C objs -f ../Makefile clean
|
|
rm -rf objs
|
|
|
|
# delete objects left over from old Makefile. (Not needed for new directory
|
|
# which started with dual makefiles.)
|
|
clean_legacy:
|
|
rm -f *.o *.d $(LIB)
|
|
rm -f linux/*.o linux/*.d linux/oal.a
|
|
|
|
|
|
shell:
|
|
bash -i
|