Radix cross Linux

The main Radix cross Linux repository contains the build scripts of packages, which have the most complete and common functionality for desktop machines

452 Commits   2 Branches   1 Tag

COMPONENT_TARGETS  = $(HARDWARE_LONGAN_NANO)

include ../../../build-system/constants.mk

# ======= __END_OF_REQUIRES__ =======

sources  = src

SRC_DIR  = $(TARGET_BUILD_DIR)/src
src_done = $(TARGET_BUILD_DIR)/.source_done

led_target     = $(TARGET_BUILD_DIR)/led.bin
display_target = $(TARGET_BUILD_DIR)/display.bin

info_target = $(TARGET_BUILD_DIR)/.info-done

USE_TARGET_DEST_DIR_SYSROOT = no

ifeq ($(HARDWARE),$(HARDWARE_LONGAN_NANO))
OPTIMIZATION_FLAGS  = -O0
ARCH_FLAGS := -march=rv32imac_zicsr -mabi=ilp32 -mcmodel=medlow
endif

BUILD_TARGETS = $(led_target) $(display_target) $(info_target)


include ../../../build-system/core.mk


ifeq ($(HARDWARE),$(HARDWARE_LONGAN_NANO))
CFLAGS  += -Wall -fmessage-length=0 --specs=nosys.specs
LDFLAGS += -Wall $(ARCH_FLAGS) -Wl,--no-relax -Wl,--gc-sections -nostdlib -nostartfiles -lc -lgcc --specs=nosys.specs
endif

$(src_done): $(sources)
	@cp -a $^ $(TARGET_BUILD_DIR)/
	@touch $@

$(led_target): $(src_done)
	@( cd $(SRC_DIR)/hello_led/ ; $(BUILD_ENVIRONMENT) $(MAKE) )
	@cp -a $(SRC_DIR)/hello_led/main.bin $@
	@touch $@

$(display_target): $(src_done)
	@( cd $(SRC_DIR)/hello_display/ ; $(BUILD_ENVIRONMENT) $(MAKE) )
	@cp -a $(SRC_DIR)/hello_display/main.bin $@
	@touch $@

$(info_target): $(led_target) $(display_target)
	@echo "==================================="
	@echo "======= Build Info:         ======="
	@echo "==================================="
	@echo "======= CC = '$(CC)'"
	@echo "======= CFLAGS = '$(CFLAGS)'"
	@echo "======= LDFLAGS = '$(LDFLAGS)'"
	@echo "======= ARCH_FLAGS = '$(ARCH_FLAGS)'"
	@echo ""
	@echo "#"
	@echo "# Please find images: `basename $(led_target)`, `basename $(display_target)` in the $(TARGET_BUILD_DIR)/ directory."
	@echo "#"
	@echo ""
	@touch $@