subdirs: removed

This commit is contained in:
Luka Vandervelden 2019-11-14 14:31:22 +01:00
parent 664098bd10
commit 9cbf1debce
2 changed files with 9 additions and 105 deletions

View File

@ -227,25 +227,17 @@ $(DESTDIR)$(INCLUDEDIR):
$(DESTDIR)$(MANDIR): $(DESTDIR)$(MANDIR):
@echo ' DIR > $(MANDIR)' @echo ' DIR > $(MANDIR)'
$(Q)mkdir -p $(DESTDIR)$(MANDIR) $(Q)mkdir -p $(DESTDIR)$(MANDIR)
install: subdirs.install build.zsh.install build/binary.zsh.install build/crystal.zsh.install build/header.zsh.install build/library.zsh.install build/livescript.zsh.install build/man.zsh.install build/moon.zsh.install build/ofile.zsh.install build/sass.zsh.install build/scdocman.zsh.install build/script.zsh.install build/sharedlib.zsh.install build/staticlib.zsh.install install: build.zsh.install build/binary.zsh.install build/crystal.zsh.install build/header.zsh.install build/library.zsh.install build/livescript.zsh.install build/man.zsh.install build/moon.zsh.install build/ofile.zsh.install build/sass.zsh.install build/scdocman.zsh.install build/script.zsh.install build/sharedlib.zsh.install build/staticlib.zsh.install
@: @:
subdirs.install: uninstall: build.zsh.uninstall build/binary.zsh.uninstall build/crystal.zsh.uninstall build/header.zsh.uninstall build/library.zsh.uninstall build/livescript.zsh.uninstall build/man.zsh.uninstall build/moon.zsh.uninstall build/ofile.zsh.uninstall build/sass.zsh.uninstall build/scdocman.zsh.uninstall build/script.zsh.uninstall build/sharedlib.zsh.uninstall build/staticlib.zsh.uninstall
uninstall: subdirs.uninstall build.zsh.uninstall build/binary.zsh.uninstall build/crystal.zsh.uninstall build/header.zsh.uninstall build/library.zsh.uninstall build/livescript.zsh.uninstall build/man.zsh.uninstall build/moon.zsh.uninstall build/ofile.zsh.uninstall build/sass.zsh.uninstall build/scdocman.zsh.uninstall build/script.zsh.uninstall build/sharedlib.zsh.uninstall build/staticlib.zsh.uninstall
@: @:
subdirs.uninstall: test: all
test: all subdirs subdirs.test
@: @:
subdirs.test:
clean: build.zsh.clean build/binary.zsh.clean build/crystal.zsh.clean build/header.zsh.clean build/library.zsh.clean build/livescript.zsh.clean build/man.zsh.clean build/moon.zsh.clean build/ofile.zsh.clean build/sass.zsh.clean build/scdocman.zsh.clean build/script.zsh.clean build/sharedlib.zsh.clean build/staticlib.zsh.clean clean: build.zsh.clean build/binary.zsh.clean build/crystal.zsh.clean build/header.zsh.clean build/library.zsh.clean build/livescript.zsh.clean build/man.zsh.clean build/moon.zsh.clean build/ofile.zsh.clean build/sass.zsh.clean build/scdocman.zsh.clean build/script.zsh.clean build/sharedlib.zsh.clean build/staticlib.zsh.clean
distclean: clean distclean: clean
dist: dist-gz dist-xz dist-bz2 dist: dist-gz dist-xz dist-bz2
$(Q)rm -- $(PACKAGE)-$(VERSION) $(Q)rm -- $(PACKAGE)-$(VERSION)
@ -361,5 +353,5 @@ help:
@echo '' @echo ''
@echo 'Rebuild the Makefile with:' @echo 'Rebuild the Makefile with:'
@echo ' zsh ./build.zsh' @echo ' zsh ./build.zsh'
.PHONY: all subdirs clean distclean dist install uninstall help .PHONY: all clean distclean dist install uninstall help

View File

@ -5,9 +5,6 @@
# (stuff *will* break if you add non-C things as targets) # (stuff *will* break if you add non-C things as targets)
# - Clean some more (or a lot). I mean, this script could even be reused if # - Clean some more (or a lot). I mean, this script could even be reused if
# it were cleaner, more readable and somewhat more documented. # it were cleaner, more readable and somewhat more documented.
# - Using subdirs creates trouble. Really. Dont do it unless its for
# completely separate, independent sub-projects.
# Also, theyre unmaintained and probably broken by now.
# #
# WARNINGS and LIMITATIONS: # WARNINGS and LIMITATIONS:
# - Using a relative path in DESTDIR= *will* fail. # - Using a relative path in DESTDIR= *will* fail.
@ -80,40 +77,6 @@ function has {
# Specialized helpers # Specialized helpers
function subdirs {
for DIR in ${subdirs[@]}; do
if $gnu; then
write "\t@echo ' ${fg_bold[red]}>> ${fg_bold[magenta]}`pwd`/${DIR}${reset_color}'"
fi
write -n "\t${Q}(cd \"${DIR}\" && $MAKE"
if $gnu; then
write -n " --no-print-directory"
fi
write -n ' Q=$(Q) CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" DESTDIR="$(DESTDIR)"'
for name value in ${variables[@]}; do
write -n " ${name}=\"\$(${name})\""
done
for name path in ${prefixes[@]}; do
write -n " ${name}=\"\$(${name})\""
done
if (( $# > 0 )); then
write -n " $@"
fi
write ")"
if $gnu; then
write "\t@echo ' ${fg_bold[red]}<< ${fg_bold[magenta]}`pwd`/${DIR}${reset_color}'"
fi
done
}
function get_distfiles { function get_distfiles {
for file in "${dist[@]}" $(echo ${sources[@]}) $(echo ${depends[@]}); do for file in "${dist[@]}" $(echo ${sources[@]}) $(echo ${depends[@]}); do
if [[ -z "${nodist[$file]}" ]]; then if [[ -z "${nodist[$file]}" ]]; then
@ -129,25 +92,6 @@ function get_distfiles {
echo "$file" echo "$file"
fi fi
done done
for dir in ${subdirs[@]}; do
(
unset dist sources depends subdirs
typeset -a dist
typeset -A sources depends
cd "$dir"
. ./project.zsh
for file in $(get_distfiles); do
local file="${dir}/${file}"
while [[ "$file" =~ "\.\./" ]]; do
file="${file/[a-z]*\/\.\.\//}"
done
echo "${file}"
done
)
done
} }
function exists { function exists {
@ -278,7 +222,7 @@ function main {
write write
if [[ -z "${all}" ]] || (( ${#all[@]} == 0 )); then if [[ -z "${all}" ]] || (( ${#all[@]} == 0 )); then
all=(${targets[@]} $((( ${#subdirs[@]} > 0 )) && echo subdirs)) all=(${targets[@]})
fi fi
write -n "all: ${all[@]}" write -n "all: ${all[@]}"
@ -394,33 +338,19 @@ function main {
write "\t${Q}mkdir -p \$(DESTDIR)\$(${dir})" write "\t${Q}mkdir -p \$(DESTDIR)\$(${dir})"
done done
(( ${#subdirs[@]} > 0 )) && { write -n "install:"
write "subdirs:"
subdirs
write
}
write -n "install: subdirs.install"
for target in ${targets[@]}; do for target in ${targets[@]}; do
write -n " ${target}.install" write -n " ${target}.install"
done done
write "\n\t@:\n" write "\n\t@:\n"
write "subdirs.install:" write -n "uninstall:"
subdirs install
write
write -n "uninstall: subdirs.uninstall"
for target in ${targets[@]}; do for target in ${targets[@]}; do
write -n " ${target}.uninstall" write -n " ${target}.uninstall"
done done
write "\n\t@:\n" write "\n\t@:\n"
write "subdirs.uninstall:" write -n "test: all"
subdirs uninstall
write
write -n "test: all subdirs subdirs.test"
for target in ${targets[@]}; do for target in ${targets[@]}; do
if exists ${type[$target]}.test; then if exists ${type[$target]}.test; then
write -n " ${target}.test" write -n " ${target}.test"
@ -435,10 +365,6 @@ function main {
write "\n\t@:\n" write "\n\t@:\n"
fi fi
write "subdirs.test:"
subdirs test
write
write -n "clean:" write -n "clean:"
(( ${#targets[@]} > 0 )) && { (( ${#targets[@]} > 0 )) && {
for target in ${targets[@]}; do for target in ${targets[@]}; do
@ -454,12 +380,8 @@ function main {
done done
} }
write write
(( ${#subdirs[@]} > 0 )) && subdirs clean
write
write "distclean: clean" write "distclean: clean"
(( ${#subdirs[@]} > 0 )) && subdirs distclean
write
if $root; then if $root; then
write "dist: dist-gz dist-xz dist-bz2" write "dist: dist-gz dist-xz dist-bz2"
@ -566,17 +488,7 @@ function main {
write " @echo '${fg_bold[white]}Rebuild the Makefile with:${reset_color}'" write " @echo '${fg_bold[white]}Rebuild the Makefile with:${reset_color}'"
write " @echo ' zsh ./build.zsh$($colors && echo -n " -c")$($gnu && echo -n " -g")'" write " @echo ' zsh ./build.zsh$($colors && echo -n " -c")$($gnu && echo -n " -g")'"
for i in ${subdirs[@]}; do write ".PHONY: all clean distclean dist install uninstall help"
(
cd $i
unset subdirs targets dist sources ldflags depends install type variables
typeset -A sources ldflags depends install type variables
typeset -a targets dist
root=false main $i
)
done
write ".PHONY: all subdirs clean distclean dist install uninstall help"
write write
} }