Skip to content

Commit

Permalink
SW: Solved non-recursive make call issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Lore0599 committed Sep 27, 2024
1 parent d9851a7 commit e7540aa
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion sw/sw.mk
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,23 @@ CHIM_SW_TEST_SRCS_C = $(wildcard $(CHIM_SW_DIR)/tests/*.c)

CHIM_SW_TEST_MEMISL_DUMP = $(CHIM_SW_TEST_SRCS_S:.S=.memisl.dump) $(CHIM_SW_TEST_SRCS_C:.c=.memisl.dump)

CHIM_SW_TESTS += $(CHIM_SW_TEST_DRAM_DUMP) $(CHIM_SW_TEST_SPM_DUMP) $(CHIM_SW_TEST_MEMISL_DUMP) $(CHIM_SW_TEST_SPM_ROMH) $(CHIM_SW_TEST_SPM_GPTH)
CHIM_SW_TESTS += $(CHIM_SW_TEST_MEMISL_DUMP)

# All objects require up-to-date patches and headers
%.o: %.c
$(CHS_SW_CC) $(CHS_SW_INCLUDES) $(CHS_SW_CCFLAGS) -c $< -o $@

%.o: %.S
$(CHS_SW_CC) $(CHS_SW_INCLUDES) $(CHS_SW_CCFLAGS) -c $< -o $@

define chim_sw_ld_elf_rule
.PRECIOUS: %.$(1).elf

%.$(1).elf: $$(CHS_SW_LD_DIR)/$(1).ld %.o $$(CHS_SW_LIBS)
$$(CHS_SW_CC) $$(CHS_SW_INCLUDES) -T$$< $$(CHS_SW_LDFLAGS) -o $$@ $$*.o $$(CHS_SW_LIBS)
endef

$(foreach link,$(patsubst $(CHS_SW_LD_DIR)/%.ld,%,$(wildcard $(CHS_SW_LD_DIR)/*.ld)),$(eval $(call chim_sw_ld_elf_rule,$(link))))

chim-sw: $(CHIM_SW_LIB) $(CHIM_SW_TESTS)

Expand Down

0 comments on commit e7540aa

Please sign in to comment.