Restructured paths

1. build is in build/$(arch)
2. tooldir is in build/toolchain-$(arch)
3. global_srcdir is in build/src-{world,toolchain}
4. global_objdir is in build/obj-{world,toolchain}
This commit is contained in:
Nathan Fisher 2021-03-02 15:13:26 -05:00
parent 61db92519f
commit a5d0778d53
19 changed files with 233 additions and 231 deletions

3
.gitignore vendored
View File

@ -22,3 +22,6 @@ src-files.mk
awkgram.tab.c
awkgram.tab.h
proctab.c
*.so
*.so.*
libbz2.so.*

122
Makefile
View File

@ -1,86 +1,88 @@
# Makefile - hhl - /usr/src
# Makefile - hhl - /src
# Copyright 2020 Nathan Fisher <nfisher.sr@gmail.com>
#
include src-config.mk
include src-files.mk
uid = $(shell id -u)
include_dir = /usr/include/mk
include_dir = /src/include/mk
make_includes += $(wildcard $(include_dir)/*.mk)
pkgdbdir = $(build)/var/db/pkg/base
plists = $(pkgdbdir)/plist $(pkgdbdir)/etc.plist
plists += $(pkgdbdir)/plist
plists += $(pkgdbdir)/etc.plist
dirs += dev
dirs += proc
dirs += run
dirs += sys
dirs = dev proc sys run
ifeq ($(arch),x86_64)
dirs += lib64
endif
alldirs = bin boot dev etc home lib lib64 media mnt \
opt proc root run sbin srv sys tmp usr var
alldirs += $(dirs)
alldirs += bin
alldirs += boot
alldirs += etc
alldirs += home
alldirs += lib
alldirs += media
alldirs += mnt
alldirs += opt
alldirs += root
alldirs += sbin
alldirs += srv
alldirs += tmp
alldirs += usr
alldirs += var
all: buildworld
toolchain-tgz: toolchain-hhl-${os_version}-${arch}.tgz
.PHONY: all
toolchain-tbz: toolchain-hhl-${os_version}-${arch}.tbz
toolchain-txz: toolchain-hhl-${os_version}-${arch}.txz
rootfs-tgz: rootfs-hhl-${os_version}-${arch}.tgz
rootfs-tbz: rootfs-hhl-${os_version}-${arch}.tbz
rootfs-txz: rootfs-hhl-${os_version}-${arch}.txz
toolchain-hhl-${os_version}-${arch}.tgz: /toolchain/.built smalltools
cd build && paxtar -M uidgid -czf ../$@ toolchain
toolchain-hhl-${os_version}-${arch}.tbz: /toolchain/.built smalltools
cd build && paxtar -M uidgid -cjf ../$@ toolchain
toolchain-hhl-${os_version}-${arch}.txz: /toolchain/.built smalltools
cd build && paxtar -M uidgid -cJf ../$@ toolchain
smalltools: /toolchain/.built
$(MAKE) -C toolchain reduce-size
buildtools: /toolchain/.built
buildtools: $(tooldir)/.built
$(info $(grn)=== Temporary toolchain build ===$(reset))
/toolchain/.built: config.mk | $(dirs)
.PHONY: buildtools
$(tooldir)/.built: config.mk | $(dirs)
$(info $(grn)=== Building temporary toolchain ===$(reset))
$(MAKE) -C toolchain
touch $@
smalltools: $(tooldir)/.built
$(MAKE) -C toolchain reduce-size
.PHONY: smalltools
toolsclean:
$(MAKE) -C toolchain clean
src-files.mk:
echo src-files = \\ > $@.in
git ls-files | sort | while read l ; do echo $${l} \\ ; done | \
sed '$$ s:\\::' >> $@.in
mv $@.in $@
.PHONY: toolsclean
buildworld: $(build)/.built $(plists)
$(info $(grn)=== World build complete ===$(reset))
.PHONY: buildworld
strip: $(build)/.stripped
.PHONY: strip
$(build)/.stripped:
for dir in $(stripdirs) ; \
do $(arch)-strip --strip-debug $${dir}/* > \
/dev/null 2>&1 || true ; done
touch $@
$(build)/.built: /toolchain/.built $(build)/.skeleton.built
$(build)/.built: $(tooldir)/.built $(build)/.skeleton.built
$(MAKE) -C world
touch $@
$(build)/.skeleton.built: | $(dirs)
install -d -m 0750 build/root
install -dv -m 1777 build/tmp build/var/tmp
[ -h build/var/run ] || ln -sv /run build/var/run
[ -h build/var/lock ] || ln -sv /run/lock build/var/lock
install -d -m 0750 $(build)/root
install -dv -m 1777 $(build)/tmp $(build)/var/tmp
[ -h build/var/run ] || ln -sv /run $(build)/var/run
[ -h build/var/lock ] || ln -sv /run/lock $(build)/var/lock
[ -c $(build)/dev/console ] || su -c "mknod -m 600 $(build)/dev/console c 5 1"
[ -c $(build)/dev/null ] || su -c "mknod -m 666 $(build)/dev/null c 1 3"
touch $@
@ -90,10 +92,34 @@ $(plists): $(build)/.built
pkgname=base $(MAKE) -C $(build) -f $(include_dir)/create-plist.mk install
$(dirs):
install -d ${build}/$@
install -d $(build)/$@
remove-toolchain:
$(MAKE) -C toolchain remove
.PHONY: remove-toolchain
toolchain-tgz: toolchain-hhl-$(os_version)-$(arch).tgz
toolchain-tbz: toolchain-hhl-$(os_version)-$(arch).tbz
toolchain-txz: toolchain-hhl-$(os_version)-$(arch).txz
.PHONY: toolchain-tgz toolchain-tbz toolchain-txz
rootfs-tgz: rootfs-hhl-$(os_version)-$(arch).tgz
rootfs-tbz: rootfs-hhl-$(os_version)-$(arch).tbz
rootfs-txz: rootfs-hhl-$(os_version)-$(arch).txz
.PHONY: rootfs-tgz rootfs-tbz rootfs-txz
toolchain-hhl-$(os_version)-$(arch).tgz: $(tooldir)/.built smalltools
paxtar -M uidgid -czf ../$@ toolchain-$(arch)
toolchain-hhl-$(os_version)-$(arch).tbz: $(tooldir)/.built smalltools
paxtar -M uidgid -cjf ../$@ toolchain-$(arch)
toolchain-hhl-$(os_version)-$(arch).txz: $(tooldir)/.built smalltools
paxtar -M uidgid -cJf ../$@ toolchain-$(arch)
rootfs-hhl-$(os_version)-$(arch).tgz: $(plists) $(build)/.stripped
cd build && paxtar -M uidgid -czf ../$@ $(alldirs)
@ -104,11 +130,15 @@ rootfs-hhl-$(os_version)-$(arch).tbz: $(plists) $(build)/.stripped
rootfs-hhl-$(os_version)-$(arch).txz: $(plists) $(build)/.stripped
cd build && paxtar -M uidgid -cJf ../$@ $(alldirs)
remove-toolchain:
$(MAKE) -C toolchain remove
clean:
$(MAKE) -C world clean
$(MAKE) -C toolchain clean
rm -rf build/*
rm -rf build/.built
rm -rf build/.skeleton.built
rm -rf build/.stripped
.PHONY: toolchain-archive buildtools smalltools toolsclean buildworld $(dirs) strip
.PHONY: clean

View File

@ -16,9 +16,9 @@ include hhl.colors.mk
endif
ifeq ($(filter armv7l aarch64, $(arch)), $(arch))
tgt = ${arch}-unknown-linux-gnueabi
tgt = $(arch)-unknown-linux-gnueabi
else
tgt = ${arch}-unknown-linux-gnu
tgt = $(arch)-unknown-linux-gnu
endif
ifeq ($(filter armv7l aarch64, $(bld_arch)), $(bld_arch))
@ -50,16 +50,19 @@ man8dir = ${mandir}/man8
distdir = ${basedir}/distfiles
toolchain = ${basedir}/toolchain
world = ${basedir}/world
build = ${basedir}/build
build = ${basedir}/build/$(arch)
distfullname ?= ${distname}-${${distname}_version}
objdirname ?= ${distfullname}
objdirname ?= obj
distext ?= xz
distfile ?= ${distfullname}.tar.${distext}
distlocal ?= ${distdir}/${distfile}
wkgdir = $(shell pwd)
srcdir ?= ${global_srcdir}/${distfullname}
srcdir ?= $(global_srcdir)/$(distfullname)
objdir ?= $(global_objdir)/$(distfullname)
tooldir = $(basedir)/build/toolchain-$(arch)
export LC_ALL = POSIX
export PATH = $(tooldir)/bin:$(tooldir)/sbin:/usr/bin:/usr/sbin:/bin:/sbin
_dhcpcd ?= 1
_wireless ?= 1
@ -67,47 +70,43 @@ _wireless ?= 1
use_configure ?= 1
no_objdir ?= 0
ifeq (${use_configure},1)
config_tgt ?= ${objdir}/Makefile
config_deps += ${srcdir}/.dirstamp
config_opts ?= --prefix=${install_prefix}
config_cmd ?= cd ${objdir} && ${srcdir}/configure ${config_opts}
build_deps ?= ${config_tgt}
ifeq ($(use_configure),1)
config_tgt ?= $(objdir)/Makefile
config_deps += $(srcdir)/.dirstamp
config_opts ?= --prefix=$(install_prefix)
config_cmd ?= cd $(objdir) && $(srcdir)/configure $(config_opts)
build_deps ?= $(config_tgt)
else
build_deps ?= ${config_deps}
build_deps += ${srcdir}/.dirstamp
build_deps ?= $(config_deps)
build_deps += $(srcdir)/.dirstamp
endif
build_cmd ?= $(MAKE) ${makeflags} -C ${objdir}
install_deps ?= ${objdir}/.built
install_cmd ?= $(MAKE) ${makeflags} -C ${objdir} install
all_deps ?= ${objdir}/.built
build_cmd ?= $(MAKE) $(makeflags) -C $(objdir)
install_deps ?= $(objdir)/.built
install_cmd ?= $(MAKE) $(makeflags) -C $(objdir) install
all_deps ?= $(objdir)/.built
ifndef internal
stamps ?= ${config_tgt} ${objdir}/.built ${objdir}/.installed
endif
ifeq (${no_objdir},1)
objdir = ${srcdir}
ifeq ($(no_objdir),1)
objdir = $(srcdir)
else
pre_dirs += ${objdir}
pre_dirs += $(objdir)
endif
ifdef patches
config_deps += ${patches} ${srcdir}/.patched
config_deps += $(patches) $(srcdir)/.patched
endif
stripdirs += ${build}/lib
stripdirs += ${build}/usr/lib
stripdirs += ${build}/bin
stripdirs += ${build}/sbin
stripdirs += ${build}/bin
stripdirs += ${build}/sbin
stripdirs += ${build}/usr/bin
stripdirs += ${build}/usr/sbin
stripdirs += ${build}/usr/bin
stripdirs += ${build}/usr/sbin
stripdirs += $(build)/lib
stripdirs += $(build)/usr/lib
stripdirs += $(build)/bin
stripdirs += $(build)/sbin
stripdirs += $(build)/bin
stripdirs += $(build)/sbin
stripdirs += $(build)/usr/bin
stripdirs += $(build)/usr/sbin
stripdirs += $(build)/usr/bin
stripdirs += $(build)/usr/sbin
${basedir}/config.mk:
$(basedir)/config.mk:
cp $(basedir)/config.mk.sample $(basedir)/config.mk
.DEFAULT_GOAL = ${default_goal}
.DEFAULT_GOAL = $(default_goal)

View File

@ -8,26 +8,30 @@ else
clean_cmd ?= rm -rf $(objdir)
endif
distclean_cmd ?= rm -rf ${objdir} ${srcdir} ${stamps}
distclean_cmd ?= rm -rf $(objdir) $(srcdir)
ifeq (${distext},gz)
ifeq ($(distext),gz)
tarflags += -xzf
endif
ifeq (${distext},bz2)
ifeq ($(distext),bz2)
tarflags += -xjf
endif
ifeq (${distext},xz)
ifeq ($(distext),xz)
tarflags += -xJf
endif
install_cmd ?= $(MAKE) DESTDIR=$(DESTDIR) -C $(objdir) install
all: ${all_deps}
all: $(all_deps)
install: ${objdir}/.installed
.PHONY: all
install: $(objdir)/.installed
$(info $(grn)=== $(distfullname) installed ===$(reset))
${objdir}/.installed: ${install_deps}
.PHONY: install
$(objdir)/.installed: $(install_deps)
$(info $(grn)=== $(distfullname) built ===$(reset))
$(info $(grn)=== Installing for $(distfullname) ===$(reset))
$(pre_install)
@ -35,9 +39,6 @@ ${objdir}/.installed: ${install_deps}
$(post_install)
touch $@
installclean:
$(MAKE) install clean
$(installdirs):
install -d $@
@ -61,13 +62,13 @@ $(srcdir)/.patched: $(patches) $(srcdir)/.dirstamp
patch -p1 < $(wkgdir)/$${patch} ; done
touch ${srcdir}/.patched
$(srcdir)/.dirstamp: $(distlocal)
$(srcdir)/.dirstamp: $(distlocal) | $(tooldir)
$(info $(grn)=== Extracting $(distlocal) ===$(reset))
tar $(tarflags) $(distlocal) -C $(global_srcdir)
touch $@
ifneq (${no_objdir},1)
${objdir}:
ifneq ($(no_objdir),1)
$(objdir):
install -d $@
endif
@ -80,28 +81,7 @@ clean:
$(clean_cmd)
distclean: clean
${distclean_cmd}
remove-objs:
rm -rf ${objs} || true
remove-srcdir:
rm -rf ${srcdir} || true
remove-objdir:
rm -rf ${objdir} || true
remove: remove-objs remove-srcdir remove-objdir
.PHONY: \
all \
install \
installclean \
finish \
clean \
distclean \
remove-objs \
remove-objdir \
remove-srcdir \
remove
$(distclean_cmd)
.PHONY: clean
.PHONY: distclean

View File

@ -2,18 +2,14 @@
# Copyright 2020 Nathan Fisher <nfisher.sr@gmail.com>
#
install_prefix = /toolchain
confdir ?= ${install_prefix}/etc
localstatedir ?= ${install_prefix}/var
logdir ?= ${localstatedir}/log
global_srcdir = /src/build/src
global_objdir = /src/build/obj
export PATH = /toolchain/bin:/usr/bin:/bin:/toolchain/sbin:/usr/sbin:/sbin
install_prefix = $(tooldir)
confdir ?= $(install_prefix)/etc
localstatedir ?= $(install_prefix)/var
logdir ?= $(localstatedir)/log
default_goal ?= install
include src-config.mk
objdir ?= ${global_objdir}/${objdirname}-toolchain
global_srcdir = $(basedir)/build/src-toolchain
global_objdir = $(basedir)/build/obj-toolchain
include src-config.mk

View File

@ -1,21 +1,16 @@
# world.mk - mk - /usr/include/mk
# Copyright 2020 Nathan Fisher <nfisher.sr@gmail.com>
DESTDIR ?= /src/build
DESTDIR ?= $(build)
export DESTDIR
global_srcdir ?= /src/build/src
global_objdir ?= /src/build/obj
#config_opts += --cache-file=$(global_objdir)/config.cache
install_cmd ?= $(MAKE) $(makeflags) DESTDIR=$(DESTDIR) -C $(objdir) install
install_prefix ?= /usr
confdir ?= ${DESTDIR}/etc
localstatedir ?= ${DESTDIR}/var
logdir ?= ${DESTDIR}/var/log
confdir ?= $(DESTDIR)/etc
localstatedir ?= $(DESTDIR)/var
logdir ?= $(DESTDIR)/var/log
export PATH = /toolchain/bin:/toolchain/sbin:/usr/bin:/usr/sbin:/bin:/sbin
ifeq (${doinstall},false)
ifeq ($(doinstall),false)
default_goal ?= all
endif
@ -25,5 +20,7 @@ else
default_goal ?= finish
endif
global_srcdir = $(basedir)/build/src-world
global_objdir = $(basedir)/build/obj-world
include src-config.mk
objdir ?= ${global_objdir}/${objdirname}-world

View File

@ -1,4 +1,4 @@
# Makefile - hhl - /usr/src/toolchain
# Makefile - hhl - /src/toolchain
# Copyright 2020 Nathan Fisher <nfisher.sr@gmail.com>
#
@ -23,7 +23,7 @@ subdirs += linux-headers
subdirs += glibc
subdirs += gcc-pass2
installdirs += $(build)/toolchain $(build)/src $(build)/obj
installdirs += $(tooldir) $(global_srcdir) $(global_objdir)
all: $(subdirs) reduce-size
$(info $(grn)=== Temporary toolchain built ===$(reset))
@ -43,31 +43,31 @@ distclean: clean
do $(MAKE) -C $${subdir} distclean ; done
strip:
strip --strip-debug /toolchain/lib/* > /dev/null 2>&1 || true
/usr/bin/strip --strip-unneeded /toolchain/bin/*> /dev/null 2>&1 || true
/usr/bin/strip --strip-unneeded /toolchain/sbin/*> /dev/null 2>&1 || true
/usr/bin/strip --strip-unneeded /toolchain/libexec/gcc/*/${gcc_version}/* || true
/usr/bin/strip --strip-debug /toolchain/bin/*> /dev/null 2>&1 || true
/usr/bin/strip --strip-debug /toolchain/sbin/*> /dev/null 2>&1 || true
/usr/bin/strip --strip-debug /toolchain/libexec/gcc/*/${gcc_version}/* || true
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 /toolchain/doc
rm -rf /toolschain/info
rm -rf /toolchain/man
rm -rf /toolchain/share/doc
rm -rf /toolschain/share/info
rm -rf /toolchain/share/man
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 /toolchain/lib /toolchain/libexec -name '*.la' -delete
find $(tooldir)/lib $(tooldir)/libexec -name '*.la' -delete
reduce-size: strip removedoc remove-la
remove: distclean
for subdir in ${subdirs} ; \
do $(MAKE) -C $${subdir} remove ; done
rm -rf /toolchain/* .built
rm -rf $(tooldir)/* .built
.PHONY: \
all \

View File

@ -2,22 +2,21 @@
# Copyright 2020 Nathan Fisher <nfisher.sr@gmail.com>
#
distname = binutils
objdirname = binutils-pass1
include toolchain.mk
config_opts += --with-sysroot=${build}
config_opts += --target=${tgt}
config_opts += --with-sysroot=$(build)
config_opts += --target=$(tgt)
config_opts += --disable-nls
config_opts += --disable-werror
ifeq (${arch}, x86_64)
install: | /toolchain/lib64
else ifeq (${arch}, riscv64)
install: | /toolchain/lib64
ifeq ($(arch), x86_64)
install: | $(tooldir)/lib64
else ifeq ($(arch), riscv64)
install: | $(tooldir)/lib64
endif
include targets.mk
/toolchain/lib64:
install -d /toolchain/lib
ln -s lib /toolchain/lib64
$(tooldir)/lib64:
install -d $(tooldir)/lib
ln -s lib $(toolcdir)/lib64

View File

@ -7,12 +7,12 @@ include ../../config.mk
ifeq ($(filter x86_64 aarch64 riscv64, $(arch)), $(arch))
patches += gcc-lib64.patch
endif
objdirname = gcc-pass1
objdir = $(global_objdir)/gcc-pass1
include toolchain.mk
srcdirs += ${srcdir}/mpfr
srcdirs += ${srcdir}/gmp
srcdirs += ${srcdir}/mpc
srcdirs += $(srcdir)/mpfr
srcdirs += $(srcdir)/gmp
srcdirs += $(srcdir)/mpc
config_opts += --target=$(tgt)
config_opts += --with-glibc-version=2.11
@ -36,18 +36,18 @@ include targets.mk
$(config_tgt): | $(srcdirs)
${srcdir}/mpfr: | ${srcdir}
$(MAKE) -C ${distdir} mpfr
tar -xJf ${distdir}/mpfr-${mpfr_version}.tar.xz -C ${srcdir}
mv ${srcdir}/mpfr-${mpfr_version} ${srcdir}/mpfr
$(srcdir)/mpfr: | $(srcdir)
$(MAKE) -C $(distdir) mpfr
tar -xJf $(distdir)/mpfr-$(mpfr_version).tar.xz -C $(srcdir)
mv $(srcdir)/mpfr-$(mpfr_version) $(srcdir)/mpfr
${srcdir}/gmp: | ${srcdir}
$(MAKE) -C ${distdir} gmp
tar -xJf ${distdir}/gmp-${gmp_version}.tar.xz -C ${srcdir}
mv ${srcdir}/gmp-${gmp_version} ${srcdir}/gmp
$(srcdir)/gmp: | $(srcdir)
$(MAKE) -C $(distdir) gmp
tar -xJf $(distdir)/gmp-$(gmp_version).tar.xz -C $(srcdir)
mv $(srcdir)/gmp-$(gmp_version) $(srcdir)/gmp
${srcdir}/mpc: | ${srcdir}
$(MAKE) -C ${distdir} mpc
tar -xzf ${distdir}/mpc-${mpc_version}.tar.gz -C ${srcdir}
mv ${srcdir}/mpc-${mpc_version} ${srcdir}/mpc
$(srcdir)/mpc: | $(srcdir)
$(MAKE) -C $(distdir) mpc
tar -xzf $(distdir)/mpc-$(mpc_version).tar.gz -C $(srcdir)
mv $(srcdir)/mpc-$(mpc_version) $(srcdir)/mpc

View File

@ -2,8 +2,8 @@
# Copyright 2020 Nathan Fisher <nfisher.sr@gmail.com>
#
distname = gcc
objdirname = gcc-pass2
include toolchain.mk
objdir = $(global_objdir)/gcc-pass2
config_opts += --target=$(tgt)
config_opts += --with-sysroot=$(build)
config_opts += --enable-languages=c,c++

View File

@ -16,14 +16,14 @@ config_opts += --disable-werror
config_opts += --enable-stack-protector=strong
config_opts += libc_cv_slibdir=/lib
ifeq (${arch},x86_64)
ifeq ($(arch),x86_64)
define makelinks
ln -sfv ../lib/ld-linux-x86-64.so.2 $(DESTDIR)/lib64
ln -sfv ../lib/ld-linux-x86-64.so.2 $(DESTDIR)/lib64/ld-lsb-x86-64.so.3
endef
else ifeq (${arch},armv7l)
else ifeq ($(arch),armv7l)
makelinks = ln -sfv ld-2.31.so $(DESTDIR)/lib/ld-linux.so.3
else ifeq (${arch},riscv64)
else ifeq ($(arch),riscv64)
makelinks = ln -sfv ../lib/ld-linux-riscv64-lp64d.so.1 $(DESTDIR)/lib64
endif
@ -36,18 +36,22 @@ define makelocales
$$(echo $${l} | cut -f 2 -d '.') $${l} --prefix=$(DESTDIR) ; done
endef
else
makelocales = $(MAKE) DESTDIR=$(DESTDIR) -C ${objdir} localedata/install-locales
makelocales = $(MAKE) DESTDIR=$(DESTDIR) -C $(objdir) localedata/install-locales
endif
define post_install
${makelinks}
install -d $(DESTDIR)/var/cache/nscd
install -m0644 ${srcdir}/nscd/nscd.conf $(DESTDIR)/etc
install -m0644 ${wkgdir}/etc/nsswitch.conf $(DESTDIR)/etc
install -m0644 ${wkgdir}/etc/ld.so.conf $(DESTDIR)/etc
${makelocales}
install -m0644 $(srcdir)/nscd/nscd.conf $(DESTDIR)/etc
install -m0644 $(wkgdir)/etc/nsswitch.conf $(DESTDIR)/etc
install -m0644 $(wkgdir)/etc/ld.so.conf $(DESTDIR)/etc
$(makelocales)
endef
include targets.mk
$(srcdir)/.dirstamp: | $(global_srcdir)
$(global_srcdir):
install -d $@

View File

@ -2,9 +2,9 @@
# Copyright 2020 Nathan Fisher <nfisher.sr@gmail.com>
#
distname = linux
config_tgt = ${objdir}/.configured
config_tgt = $(objdir)/.configured
include toolchain.mk
config_cmd = $(MAKE) -C ${srcdir} mrproper
config_cmd = $(MAKE) -C $(srcdir) mrproper
ifeq ($(arch), armv7l)
export ARCH=arm
else ifeq ($(arch), aarch64)
@ -14,14 +14,14 @@ export ARCH=riscv
else ifeq ($(arch), risv32)
export ARCH=riscv
endif
build_cmd = KBUILD_OUTPUT=${objdir} $(MAKE) -C ${srcdir} headers
build_cmd = KBUILD_OUTPUT=$(objdir) $(MAKE) -C $(srcdir) headers
define post_build
find ${objdir}/usr/include -name '.*' -delete
rm -rf ${objdir}/usr/include/Makefile || true
find $(objdir)/usr/include -name '.*' -delete
rm -rf $(objdir)/usr/include/Makefile || true
install -d $(build)/usr/include
endef
install_cmd = cp -r ${objdir}/usr/include/* $(build)/usr/include
clean_cmd = KBUILD_OUTPUT=${objdir} $(MAKE) -C ${srcdir} clean
distclean_cmd = KBUILD_OUTPUT=${objdir} $(MAKE) -C ${srcdir} distclean
install_cmd = cp -r $(objdir)/usr/include/* $(build)/usr/include
clean_cmd = KBUILD_OUTPUT=$(objdir) $(MAKE) -C $(srcdir) clean
distclean_cmd = KBUILD_OUTPUT=$(objdir) $(MAKE) -C $(srcdir) distclean
include targets.mk

View File

@ -3,7 +3,7 @@
#
include ../../config.mk
progname = paxtar
bindir = /toolchain/bin
bindir = $(tooldir)/bin
src = $(basedir)/world/bin/pax/src
cflags += -O2
@ -13,10 +13,9 @@ cflags += -fstack-protector-strong
cflags += -Wall
cflags += -fwrapv
objdir ?= ${global_objdir}/${progname}
srcs += $(wildcard ${src}/*.c)
objs += $(patsubst ${src}/%.c,${objdir}/%.o,${srcs})
hdrs += $(wildcard ${src}/*.h)
srcs += $(wildcard $(src)/*.c)
objs += $(patsubst $(src)/%.c,$(objdir)/%.o,$(srcs))
hdrs += $(wildcard $(src)/*.h)
include world.mk
install: $(bindir)/$(progname)

View File

@ -5,17 +5,17 @@ distname = perl
export BUILD_ZLIB = False
export BUILD_BZIP2 = 0
include toolchain.mk
config_opts = -des
config_opts += -Dmksymlinks
config_opts += -Dprefix=/toolchain
config_opts += -Dprefix=$(tooldir)
config_opts += -Dvendorprefix=/usr
config_opts += -Dman1dir=/toolchain/share/man/man1
config_opts += -Dman3dir=/toolchain/share/man/man3
config_opts += -Dman1dir=$(tooldir)/share/man/man1
config_opts += -Dman3dir=$(tooldir)/share/man/man3
config_opts += -Duseshrplib
config_opts += -Dusethreads
include toolchain.mk
config_cmd = cd $(objdir) && $(srcdir)/Configure $(config_opts)
include targets.mk

View File

@ -100,16 +100,11 @@ subdirs += libnl
subdirs += wpa_supplicant
endif
installdirs = $(build)/src $(build)/obj
all: $(subdirs)
$(subdirs): | $(installdirs)
$(subdirs):
$(MAKE) -C $@
$(installdirs):
install -d $@
clean:
for subdir in $(subdirs) ; \
do $(MAKE) -C $${subdir} clean ; done
@ -118,4 +113,4 @@ distclean: clean
for subdir in $(subdirs) ; \
do $(MAKE) -C $${subdir} distclean ; done
.PHONY: ${subdirs} all clean distclean
.PHONY: $(subdirs) all clean distclean

Binary file not shown.

View File

@ -1,4 +1,4 @@
# Makefile - hhl - /usr/src/world/mandoc
# Makefile - hhl - /src/world/mandoc
# Copyright 2020 Nathan Fisher <nfisher.sr@gmail.com>
#
distname = mandoc

View File

@ -2,7 +2,7 @@ BUILD_TARGETS =
INSTALL_TARGETS =
CC = $(tgt_cc)
CFLAGS = -g -W -Wall -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wno-unused-parameter
CFLAGS += --sysroot=/src/build
CFLAGS += --sysroot=$(DESTDIR)
LDADD = -lz
LDFLAGS =
STATIC = -static

View File

@ -7,7 +7,7 @@ no_objdir = 1
use_configure = 0
include world.mk
export CC = $(tgt)-gcc
export CFLAGS = --sysroot=/src/build -Wall -O2
export CFLAGS = --sysroot=$(build) -Wall -O2
install_cmd = $(MAKE) prefix=/usr DESTDIR=$(DESTDIR) -C $(srcdir) install
define post_install