diff options
author | Nathaniel Graff <nathaniel.graff@sifive.com> | 2019-03-12 10:22:46 -0700 |
---|---|---|
committer | Nathaniel Graff <nathaniel.graff@sifive.com> | 2019-03-12 15:37:07 -0700 |
commit | e106e9e51e8c8e9aca053f1cdc3d49c85df98212 (patch) | |
tree | 0e60d656718c8d58f7841639caa3c9187c0be465 /scripts | |
parent | 1b72ca73835d6064b467a126a392f4539fa2f10a (diff) |
Build program into SRC_DIR/CONFIGURATION/PROGRAM
Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/standalone.mk | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/standalone.mk b/scripts/standalone.mk index 73b9776..17fec17 100644 --- a/scripts/standalone.mk +++ b/scripts/standalone.mk @@ -112,8 +112,8 @@ include $(CONFIGURATION).mk # Software ############################################################# -PROGRAM_ELF ?= $(SRC_DIR)/$(PROGRAM).elf -PROGRAM_HEX ?= $(SRC_DIR)/$(PROGRAM).hex +PROGRAM_ELF ?= $(SRC_DIR)/$(CONFIGURATION)/$(PROGRAM).elf +PROGRAM_HEX ?= $(SRC_DIR)/$(CONFIGURATION)/$(PROGRAM).hex .PHONY: all all: software @@ -135,7 +135,8 @@ $(PROGRAM_ELF): \ $(BSP_DIR)/install/lib/$(CONFIGURATION)/libmetal.a \ $(BSP_DIR)/install/lib/$(CONFIGURATION)/libmetal-gloss.a \ $(BSP_DIR)/metal.lds - $(MAKE) -C $(dir $@) $(basename $(notdir $@)) \ + mkdir -p $(dir $@) + $(MAKE) -C $(SRC_DIR) $(basename $(notdir $@)) \ AR=$(RISCV_AR) \ CC=$(RISCV_GCC) \ CXX=$(RISCV_GXX) \ @@ -143,6 +144,7 @@ $(PROGRAM_ELF): \ CXXFLAGS="$(RISCV_CXXFLAGS)" \ LDFLAGS="$(RISCV_LDFLAGS)" \ LDLIBS="$(RISCV_LDLIBS)" + mv $(SRC_DIR)/$(basename $(notdir $@)) $@ touch -c $@ $(RISCV_SIZE) $@ @@ -158,6 +160,7 @@ endif .PHONY: clean-software clean-software: $(MAKE) -C $(SRC_DIR) clean + rm -rf $(SRC_DIR)/$(CONFIGURATION) .PHONY: clean clean: clean-software |