tests: makefiles need to handle linker script generators too
Without this you get errors about not finding the linker script (because it will be generated) and linker errors due to bare -l flags.
This commit is contained in:
parent
b48b94fa07
commit
64e26832c7
@ -100,7 +100,10 @@ ifeq ($(V),99)
|
||||
TGT_LDFLAGS += -Wl,--print-gc-sections
|
||||
endif
|
||||
|
||||
# Linker script generator fills this in for us.
|
||||
ifeq (,$(DEVICE))
|
||||
LDLIBS += -l$(OPENCM3_LIB)
|
||||
endif
|
||||
# nosys is only in newer gcc-arm-embedded...
|
||||
#LDLIBS += -specs=nosys.specs
|
||||
LDLIBS += -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group
|
||||
@ -119,10 +122,13 @@ LDLIBS += -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group
|
||||
all: $(PROJECT).elf $(PROJECT).bin
|
||||
flash: $(PROJECT).flash
|
||||
|
||||
# error if not using linker script generator
|
||||
ifeq (,$(DEVICE))
|
||||
$(LDSCRIPT):
|
||||
ifeq (,$(wildcard $(LDSCRIPT)))
|
||||
$(error Unable to find specified linker script: $(LDSCRIPT))
|
||||
endif
|
||||
endif
|
||||
|
||||
# Need a special rule to have a bin dir
|
||||
$(BUILD_DIR)/%.o: %.c
|
||||
|
Loading…
x
Reference in New Issue
Block a user