src/toolchain/Makefile

85 lines
1.9 KiB
Makefile

# Makefile - hhl - /src/toolchain
# Copyright 2020 Nathan Fisher <nfisher.sr@gmail.com>
#
include toolchain.mk
ifeq ($(build_gawk), 1)
subdirs += gawk
endif
ifeq ($(build_pax), 1)
subdirs += pax
endif
ifeq ($(build_perl), 1)
subdirs += perl
subdirs += xml-parser
endif
ifeq ($(build_python), 1)
subdirs += python
endif
subdirs += binutils
subdirs += gcc-pass1
subdirs += linux-headers
subdirs += glibc
#subdirs += musl
subdirs += gcc-pass2
installdirs += $(tooldir) $(global_srcdir) $(global_objdir)
all: $(subdirs) reduce-size
$(info $(grn)=== Temporary toolchain built ===$(reset))
$(subdirs): | $(installdirs)
$(MAKE) -C $@
$(installdirs):
install -d $@
clean:
for subdir in $(subdirs) ; \
do $(MAKE) -C $${subdir} clean ; done
distclean: clean
for subdir in $(subdirs) ; \
do $(MAKE) -C $${subdir} distclean ; done
strip:
strip --strip-debug $(tooldir)/lib/* > /dev/null 2>&1 || true
/usr/bin/strip --strip-unneeded $(tooldir)/bin/*> /dev/null 2>&1 || true
/usr/bin/strip --strip-unneeded $(tooldir)/sbin/*> /dev/null 2>&1 || true
/usr/bin/strip --strip-unneeded $(tooldir)/libexec/gcc/*/${gcc_version}/* || true
/usr/bin/strip --strip-debug $(tooldir)/bin/*> /dev/null 2>&1 || true
/usr/bin/strip --strip-debug $(tooldir)/sbin/*> /dev/null 2>&1 || true
/usr/bin/strip --strip-debug $(tooldir)/libexec/gcc/*/$(gcc_version)/* || true
removedoc:
rm -rf $(tooldir)/doc
rm -rf $(tooldir)/info
rm -rf $(tooldir)/man
rm -rf $(tooldir)/share/doc
rm -rf $(tooldir)/share/info
rm -rf $(tooldir)/share/man
remove-la:
find $(tooldir) -name '*.la' -delete
reduce-size: strip removedoc remove-la
remove: distclean
for subdir in ${subdirs} ; \
do $(MAKE) -C $${subdir} remove ; done
rm -rf $(tooldir)/* .built
.PHONY: \
all \
${subdirs} \
clean \
distclean \
strip \
removedoc \
remove-la \
reduce-size \
remove
.DEFAULT_GOAL = all