1
0
mirror of git://git.2f30.org/morpheus.git synced 2024-06-16 09:08:33 +00:00
morpheus/mkfile
2014-03-02 21:03:35 +00:00

41 lines
1.0 KiB
Makefile
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<config.mk
allpkgs = `{ls pkgs/*}
pkgs = ${allpkgs:pkgs/%=%}
help:VQ:
printf 'Usage: mk pkg...\n'
printf '\nTo build all the targets in pkgs/, run `mk world´\n'
all world:VQ: $pkgs
clean:V:
rm -f .cache/* pkgs.mk
clean-all clean-world:V: clean
rm -rf ${root} src
fetchpkgs = ${pkgs:%=%-fetch}
fetch-all fetch-world:VQ: ${fetchpkgs}
# generate a pkgs.mk file with the targets for all packages in pkgs/
`{ mkdir -p src }
`{ mkdir -p .cache }
`{ printf '# auto-generated file, do not edit\n' > pkgs.mk }
`{ cd pkgs && for pkg in *; do cat $pkg ../stuff/fetch-pkg.mk |\
sed -e "s,^build:,$pkg:QP./stuff/cmp-pkgs: $pkg-fetch pkgs/$pkg," |\
sed -e "s,^fetch-target:,$pkg-fetch:," |\
sed -e "s,^v=,_${pkg}_v=," |\
sed -e "s,\$v,\${_${pkg}_v},g" |\
sed -e "s,\$url,\${_${pkg}_url},g" |\
sed -e "s, url=, _${pkg}_url=,g" |\
sed -e "s,\$git,\${_${pkg}_git},g" |\
sed -e "s,^git=,_${pkg}_git=," |\
sed -e "s,^url=,_${pkg}_url=," >> ../pkgs.mk; done }
<pkgs.mk
bootable:V:
stuff/create-bootable "$root" morpheus-$arch-$version.img