summaryrefslogtreecommitdiffstats
path: root/klcc/Kbuild
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 17:06:04 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 17:06:04 +0000
commit2f0649f6fe411d7e07c8d56cf8ea56db53536da8 (patch)
tree778611fb52176dce1ad06c68e87b2cb348ca0f7b /klcc/Kbuild
parentInitial commit. (diff)
downloadklibc-5d59bef0406ec5b526d04080317d1f3898723a76.tar.xz
klibc-5d59bef0406ec5b526d04080317d1f3898723a76.zip
Adding upstream version 2.0.13.upstream/2.0.13upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'klcc/Kbuild')
-rw-r--r--klcc/Kbuild47
1 files changed, 47 insertions, 0 deletions
diff --git a/klcc/Kbuild b/klcc/Kbuild
new file mode 100644
index 0000000..82ca0e8
--- /dev/null
+++ b/klcc/Kbuild
@@ -0,0 +1,47 @@
+#
+# Build klcc
+#
+
+always := $(KLIBCCROSS)klcc
+
+$(obj)/$(KLIBCCROSS)klibc.config: $(src)/Kbuild \
+ $(srctree)/Makefile \
+ $(srctree)/scripts/Kbuild.klibc
+ @$(kecho) ' GEN $@'
+ $(Q)rm -f $@
+ $(Q)echo 'ARCH=$(KLIBCARCH)' >> $@
+ $(Q)echo 'ARCHDIR=$(KLIBCARCHDIR)' >> $@
+ $(Q)echo 'CROSS=$(KLIBCROSS)' >> $@
+ $(Q)echo 'KCROSS=$(KCROSS)' >> $@
+ $(Q)echo 'CC=$(KLIBCCC)' >> $@
+ $(Q)echo 'LD=$(KLIBCLD)' >> $@
+ $(Q)echo 'REQFLAGS=$(filter-out -I%,$(KLIBCDEFS) $(KLIBCREQFLAGS) $(KLIBCARCHREQFLAGS) $(KLIBCCPPFLAGS))' >> $@
+ $(Q)echo 'OPTFLAGS=$(KLIBCOPTFLAGS)' >> $@
+ $(Q)echo 'LDFLAGS=$(KLIBCLDFLAGS)' >> $@
+ $(Q)echo 'STRIP=$(STRIP)' >> $@
+ $(Q)echo 'STRIPFLAGS=$(KLIBCSTRIPFLAGS)' >> $@
+ $(Q)echo 'EMAIN=$(KLIBCEMAIN)' >> $@
+ $(Q)echo 'CRTSHARED=$(notdir $(KLIBCCRTSHARED))' >> $@
+ $(Q)echo 'BITSIZE=$(KLIBCBITSIZE)' >> $@
+ $(Q)echo 'VERSION=$(shell cat $(srctree)/usr/klibc/version)' >> $@
+ $(Q)echo 'prefix=$(INSTALLDIR)' >> $@
+ $(Q)echo 'bindir=$(INSTALLDIR)/$(KCROSS)bin' >> $@
+ $(Q)echo 'libdir=$(INSTALLDIR)/$(KCROSS)lib' >> $@
+ $(Q)echo 'includedir=$(INSTALLDIR)/$(KCROSS)include' >> $@
+
+
+# Generate klcc
+targets := $(KLIBCCROSS)klcc
+
+quiet_cmd_klcc = GEN $@
+ cmd_klcc = $(PERL) $< $(srctree)/$(src)/klcc.in \
+ $(obj)/$(KLIBCCROSS)klibc.config \
+ $(shell command -v $(PERL) 2>/dev/null) \
+ > $@ || ( rm -f $@ ; exit 1 ) && \
+ chmod a+x $@
+$(obj)/$(KLIBCCROSS)klcc: $(src)/makeklcc.pl $(src)/klcc.in \
+ $(obj)/$(KLIBCCROSS)klibc.config
+ $(call if_changed,klcc)
+
+# Cleaning targets
+clean-files := $(KLIBCCROSS)klibc.config $(KLIBCCROSS)klcc