You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
123 lines
3.3 KiB
123 lines
3.3 KiB
# makefile to setup and initialize the final buildsystem
|
|
|
|
BOOTSTRAP = targetprefix
|
|
BOOTSTRAP += $(D)
|
|
BOOTSTRAP += $(BUILD_TMP)
|
|
BOOTSTRAP += $(CROSS_DIR)
|
|
BOOTSTRAP += $(STAGING_DIR)
|
|
BOOTSTRAP += $(IMAGE_DIR)
|
|
BOOTSTRAP += $(UPDATE_DIR)
|
|
BOOTSTRAP += $(HOST_DIR)/bin
|
|
BOOTSTRAP += libs
|
|
BOOTSTRAP += firmware
|
|
BOOTSTRAP += modules
|
|
BOOTSTRAP += host-preqs
|
|
BOOTSTRAP += $(TARGET_LIB_DIR)/libc.so.6
|
|
|
|
ifeq ($(BOXSERIES), $(filter $(BOXSERIES), hd2 hd51))
|
|
BOOTSTRAP += blobs
|
|
endif
|
|
|
|
bootstrap: $(BOOTSTRAP)
|
|
@echo -e "$(TERM_YELLOW)Bootstrapped for $(shell echo $(BOXTYPE) | sed 's/.*/\u&/') $(BOXMODEL)$(TERM_NORMAL)"
|
|
|
|
skeleton: | $(TARGET_DIR)
|
|
cp --remove-destination -a $(SKEL_ROOT)/* $(TARGET_DIR)/
|
|
if [ -d $(SKEL_ROOT)-$(BOXFAMILY)/ ]; then \
|
|
cp -a $(SKEL_ROOT)-$(BOXFAMILY)/* $(TARGET_DIR)/; \
|
|
fi
|
|
|
|
targetprefix:
|
|
mkdir -p $(TARGET_DIR)
|
|
mkdir -p $(TARGET_DIR)/bin
|
|
mkdir -p $(TARGET_INCLUDE_DIR)
|
|
mkdir -p $(PKG_CONFIG_PATH)
|
|
make skeleton
|
|
|
|
$(TARGET_DIR):
|
|
@echo "**********************************************************************"
|
|
@echo "TARGET_DIR does not exist. You probably need to run 'make bootstrap'"
|
|
@echo "**********************************************************************"
|
|
@echo ""
|
|
@false
|
|
|
|
$(D) \
|
|
$(BUILD_TMP) \
|
|
$(CROSS_DIR) \
|
|
$(STAGING_DIR) \
|
|
$(IMAGE_DIR) \
|
|
$(UPDATE_DIR) \
|
|
$(HOST_DIR):
|
|
mkdir -p $@
|
|
|
|
$(HOST_DIR)/bin: $(HOST_DIR)
|
|
mkdir -p $@
|
|
|
|
$(TARGET_LIB_DIR): | $(TARGET_DIR)
|
|
mkdir -p $@
|
|
cp -a $(SOURCE_DIR)/$(NI_DRIVERS-BIN)/$(DRIVERS_DIR)/libs/* $@
|
|
ifeq ($(BOXTYPE), coolstream)
|
|
cp -a $(SOURCE_DIR)/$(NI_DRIVERS-BIN)/$(DRIVERS_DIR)/libcoolstream/$(shell echo -n $(NI_FFMPEG_BRANCH) | sed 's,/,-,g')/* $@
|
|
ifeq ($(BOXSERIES), hd1)
|
|
ln -sf libnxp.so $@/libconexant.so
|
|
endif
|
|
endif
|
|
|
|
$(TARGET_LIB_DIR)/firmware: | $(TARGET_DIR)
|
|
mkdir -p $@
|
|
cp -a $(SOURCE_DIR)/$(NI_DRIVERS-BIN)/$(DRIVERS_DIR)/firmware/* $@/
|
|
|
|
$(TARGET_LIB_DIR)/modules: | $(TARGET_DIR)
|
|
mkdir -p $@
|
|
cp -a $(SOURCE_DIR)/$(NI_DRIVERS-BIN)/$(DRIVERS_DIR)/drivers/$(KERNEL_VERSION_FULL) $@/
|
|
|
|
$(TARGET_LIB_DIR)/libc.so.6: | $(TARGET_DIR)
|
|
if test -e $(CROSS_DIR)/$(TARGET)/sys-root/lib; then \
|
|
cp -a $(CROSS_DIR)/$(TARGET)/sys-root/lib/*so* $(TARGET_LIB_DIR); \
|
|
else \
|
|
cp -a $(CROSS_DIR)/$(TARGET)/lib/*so* $(TARGET_LIB_DIR); \
|
|
fi
|
|
|
|
$(STATIC_LIB_DIR): | $(TARGET_DIR)
|
|
mkdir -p $@
|
|
if [ -d $(STATIC_DIR)/ ]; then \
|
|
cp -a $(STATIC_DIR)/* $(TARGET_DIR)/; \
|
|
fi
|
|
|
|
$(TARGET_DIR)/var/update: | $(TARGET_DIR)
|
|
mkdir -p $@
|
|
ifeq ($(BOXTYPE), coolstream)
|
|
cp -a $(SOURCE_DIR)/$(NI_DRIVERS-BIN)/$(DRIVERS_DIR)/uldr.bin $@/
|
|
ifeq ($(BOXMODEL), kronos_v2)
|
|
cp -a $(SOURCE_DIR)/$(NI_DRIVERS-BIN)/$(DRIVERS_DIR)/u-boot.bin.link $@/u-boot.bin
|
|
else
|
|
cp -a $(SOURCE_DIR)/$(NI_DRIVERS-BIN)/$(DRIVERS_DIR)/u-boot.bin $@/
|
|
endif
|
|
endif
|
|
|
|
libs: $(TARGET_LIB_DIR) static-libs $(STATIC_LIB_DIR)
|
|
|
|
firmware: $(TARGET_LIB_DIR)/firmware
|
|
|
|
modules: $(TARGET_LIB_DIR)/modules
|
|
|
|
blobs: $(TARGET_DIR)/var/update
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
# hack to make sure they are always copied
|
|
PHONY += $(TARGET_LIB_DIR)
|
|
PHONY += $(TARGET_LIB_DIR)/firmware
|
|
PHONY += $(TARGET_LIB_DIR)/modules
|
|
PHONY += $(TARGET_DIR)/var/update
|
|
PHONY += $(STATIC_LIB_DIR)
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
PHONY += bootstrap
|
|
PHONY += skeleton
|
|
PHONY += targetprefix
|
|
PHONY += libs
|
|
PHONY += firmware
|
|
PHONY += modules
|
|
PHONY += blobs
|
|
|