Skip to content

Commit

Permalink
Make: separate rule to generate final linker script
Browse files Browse the repository at this point in the history
Signed-off-by: Bjoern Doebel <[email protected]>
  • Loading branch information
bjoernd committed Aug 30, 2020
1 parent f36433d commit 63454e3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,19 @@ else
all: docker$(TARGET)
endif

$(TARGET): $(OBJS)
$(PREP_LINK_SCRIPT) : $(LINK_SCRIPT)
@ $(CC) $(AFLAGS) -E -P -C -x c $< -o $@

$(TARGET): $(OBJS) $(PREP_LINK_SCRIPT)
@echo "LD " $@
@ $(CC) $(AFLAGS) -E -P -C -x c $(LINK_SCRIPT) -o $(PREP_LINK_SCRIPT)
@ $(LD) -T $(PREP_LINK_SCRIPT) -o $@ $^
@echo "GEN " $(SYMBOLS_NAME).S
@ $(NM) -p --format=posix $(TARGET) | $(PYTHON) $(SYMBOLS_DIR)/$(SYMBOLS_TOOL)
@echo "CC " $(SYMBOLS_NAME).S
@ $(CC) -c -o $(SYMBOLS_NAME).o $(AFLAGS) $(SYMBOLS_NAME).S
@ rm -rf $(SYMBOLS_NAME).S
@echo "LD " $(TARGET) $(SYMBOLS_NAME).o
@ $(LD) -T $(PREP_LINK_SCRIPT) -o $@ $^ $(SYMBOLS_NAME).o
@ $(LD) -T $(PREP_LINK_SCRIPT) -o $@ $(OBJS) $(SYMBOLS_NAME).o

%.o: %.S
@echo "AS " $@
Expand Down

0 comments on commit 63454e3

Please sign in to comment.