summaryrefslogtreecommitdiff
path: root/payloads/libpayload/Makefile.mk
diff options
context:
space:
mode:
Diffstat (limited to 'payloads/libpayload/Makefile.mk')
-rw-r--r--payloads/libpayload/Makefile.mk8
1 files changed, 6 insertions, 2 deletions
diff --git a/payloads/libpayload/Makefile.mk b/payloads/libpayload/Makefile.mk
index d654995889..d5a9a817fc 100644
--- a/payloads/libpayload/Makefile.mk
+++ b/payloads/libpayload/Makefile.mk
@@ -96,7 +96,7 @@ $(obj)/libpayload-config.h: $(KCONFIG_AUTOHEADER) $(obj)/libpayload.config
cmp $@ $< 2>/dev/null || cp $< $@
library-targets = $(addsuffix .a,$(addprefix $(obj)/,$(libraries))) $(obj)/libpayload.a
-lib: $$(library-targets)
+lib: $$(library-targets) $(obj)/libpayload.ldscript
extract_nth=$(word $(1), $(subst |, ,$(2)))
@@ -115,11 +115,15 @@ $(obj)/%.a: $$(%-objs)
printf " AR $(subst $(CURDIR)/,,$(@))\n"
printf "create $@\n$(foreach objc,$(filter-out %.a,$^),addmod $(objc)\n)$(foreach lib,$(filter %.a,$^),addlib $(lib)\n)save\nend\n" | $(AR) -M
+$(obj)/libpayload.ldscript: arch/$(ARCHDIR-y)/libpayload.ldscript
+ @printf " LDSCRIPT $@\n"
+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -E -P -x assembler-with-cpp -undef -o $@ $<
+
install: real-target
printf " INSTALL $(DESTDIR)/libpayload/lib\n"
install -m 755 -d $(DESTDIR)/libpayload/lib
install -m 644 $(library-targets) $(DESTDIR)/libpayload/lib/
- install -m 644 arch/$(ARCHDIR-y)/libpayload.ldscript $(DESTDIR)/libpayload/lib/
+ install -m 644 $(obj)/libpayload.ldscript $(DESTDIR)/libpayload/lib/
install -m 755 -d $(DESTDIR)/libpayload/lib/$(ARCHDIR-y)
printf " INSTALL $(DESTDIR)/libpayload/include\n"
install -m 755 -d $(DESTDIR)/libpayload/include