Create a .ld file

This commit is contained in:
Maschell 2020-06-10 12:59:07 +02:00
parent 562ad7ec83
commit 3022c8cd1d
2 changed files with 10 additions and 3 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@ lib/
CMakeLists.txt
.idea/
cmake-build-debug/
share/libfunctionpatcher.ld

View File

@ -99,10 +99,10 @@ export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
.PHONY: all dist-bin dist-src dist install clean
#---------------------------------------------------------------------------------
all: lib/libfunctionpatcher.a
all: lib/libfunctionpatcher.a share/libfunctionpatcher.ld
dist-bin: all
@tar --exclude=*~ -cjf libfunctionpatcher-$(VERSION).tar.bz2 include lib
@tar --exclude=*~ -cjf libfunctionpatcher-$(VERSION).tar.bz2 include lib share
dist-src:
@tar --exclude=*~ -cjf libfunctionpatcher-src-$(VERSION).tar.bz2 include source Makefile
@ -116,9 +116,15 @@ install: dist-bin
lib:
@[ -d $@ ] || mkdir -p $@
share:
@[ -d $@ ] || mkdir -p $@
release:
@[ -d $@ ] || mkdir -p $@
share/libfunctionpatcher.ld :$(SOURCES) $(INCLUDES) | share release
mv $(CURDIR)/release/*.ld $(CURDIR)/$@
lib/libfunctionpatcher.a :$(SOURCES) $(INCLUDES) | lib release
@$(MAKE) BUILD=release OUTPUT=$(CURDIR)/$@ \
BUILD_CFLAGS="-DNDEBUG=1 -O2 -s" \
@ -146,7 +152,7 @@ $(OFILES_SRC) : $(HFILES)
#---------------------------------------------------------------------------------
%.o: %.def
$(SILENTMSG) $(notdir $<)
$(SILENTCMD)rplimportgen $< $*.s --forceSingleSection $(ERROR_FILTER)
$(SILENTCMD)rplimportgen $< $*.s $*.ld $(ERROR_FILTER)
$(SILENTCMD)$(CC) -x assembler-with-cpp $(ASFLAGS) -c $*.s -o $@ $(ERROR_FILTER)
#---------------------------------------------------------------------------------