Style update, BECAUSE.

This commit is contained in:
Luka Vandervelden 2017-08-18 19:29:29 +02:00
parent b7261d1cee
commit e3005cdcc1
2 changed files with 73 additions and 61 deletions

118
Makefile
View File

@ -16,144 +16,145 @@ LDFLAGS :=
Q := @ Q := @
all: build.zsh build/binary.zsh build/crystal.zsh build/library.zsh build/moon.zsh build/ofile.zsh build/script.zsh build/sharedlib.zsh build/staticlib.zsh all: build.zsh build/binary.zsh build/crystal.zsh build/library.zsh build/moon.zsh build/ofile.zsh build/script.zsh build/sharedlib.zsh build/staticlib.zsh
@:
build.zsh: build.zsh.in build.zsh: build.zsh.in
@echo ' [SED] build.zsh' @echo ' SED > build.zsh'
$(Q)sed -e 's&@LIBDIR@&$(LIBDIR)&;s&@BINDIR@&$(BINDIR)&;s&@SHAREDIR@&$(SHAREDIR)&;' build.zsh.in > 'build.zsh' $(Q)sed -e 's&@LIBDIR@&$(LIBDIR)&;s&@BINDIR@&$(BINDIR)&;s&@SHAREDIR@&$(SHAREDIR)&;' build.zsh.in > 'build.zsh'
$(Q)chmod +x 'build.zsh' $(Q)chmod +x 'build.zsh'
build.zsh.install: build.zsh build.zsh.install: build.zsh
@echo ' [IN] $(BINDIR)/build.zsh' @echo ' IN > $(BINDIR)/build.zsh'
$(Q)mkdir -p '$(DESTDIR)$(BINDIR)' $(Q)mkdir -p '$(DESTDIR)$(BINDIR)'
$(Q)install -m0755 build.zsh $(DESTDIR)$(BINDIR)/build.zsh $(Q)install -m0755 build.zsh $(DESTDIR)$(BINDIR)/build.zsh
build.zsh.clean: build.zsh.clean:
@echo ' [RM] build.zsh' @echo ' RM > build.zsh'
$(Q)rm -f build.zsh $(Q)rm -f build.zsh
build.zsh.uninstall: build.zsh.uninstall:
@echo ' [RM] $(BINDIR)/build.zsh' @echo ' RM > $(BINDIR)/build.zsh'
$(Q)rm -f '$(DESTDIR)$(BINDIR)/build.zsh' $(Q)rm -f '$(DESTDIR)$(BINDIR)/build.zsh'
build/binary.zsh: build/binary.zsh:
build/binary.zsh.install: build/binary.zsh build/binary.zsh.install: build/binary.zsh
@echo ' [IN] $(SHAREDIR)/build.zsh/binary.zsh' @echo ' IN > $(SHAREDIR)/build.zsh/binary.zsh'
$(Q)mkdir -p '$(DESTDIR)$(SHAREDIR)/build.zsh' $(Q)mkdir -p '$(DESTDIR)$(SHAREDIR)/build.zsh'
$(Q)install -m0755 build/binary.zsh $(DESTDIR)$(SHAREDIR)/build.zsh/binary.zsh $(Q)install -m0755 build/binary.zsh $(DESTDIR)$(SHAREDIR)/build.zsh/binary.zsh
build/binary.zsh.clean: build/binary.zsh.clean:
build/binary.zsh.uninstall: build/binary.zsh.uninstall:
@echo ' [RM] $(SHAREDIR)/build.zsh/binary.zsh' @echo ' RM > $(SHAREDIR)/build.zsh/binary.zsh'
$(Q)rm -f '$(DESTDIR)$(SHAREDIR)/build.zsh/binary.zsh' $(Q)rm -f '$(DESTDIR)$(SHAREDIR)/build.zsh/binary.zsh'
build/crystal.zsh: build/crystal.zsh:
build/crystal.zsh.install: build/crystal.zsh build/crystal.zsh.install: build/crystal.zsh
@echo ' [IN] $(SHAREDIR)/build.zsh/crystal.zsh' @echo ' IN > $(SHAREDIR)/build.zsh/crystal.zsh'
$(Q)mkdir -p '$(DESTDIR)$(SHAREDIR)/build.zsh' $(Q)mkdir -p '$(DESTDIR)$(SHAREDIR)/build.zsh'
$(Q)install -m0755 build/crystal.zsh $(DESTDIR)$(SHAREDIR)/build.zsh/crystal.zsh $(Q)install -m0755 build/crystal.zsh $(DESTDIR)$(SHAREDIR)/build.zsh/crystal.zsh
build/crystal.zsh.clean: build/crystal.zsh.clean:
build/crystal.zsh.uninstall: build/crystal.zsh.uninstall:
@echo ' [RM] $(SHAREDIR)/build.zsh/crystal.zsh' @echo ' RM > $(SHAREDIR)/build.zsh/crystal.zsh'
$(Q)rm -f '$(DESTDIR)$(SHAREDIR)/build.zsh/crystal.zsh' $(Q)rm -f '$(DESTDIR)$(SHAREDIR)/build.zsh/crystal.zsh'
build/library.zsh: build/library.zsh:
build/library.zsh.install: build/library.zsh build/library.zsh.install: build/library.zsh
@echo ' [IN] $(SHAREDIR)/build.zsh/library.zsh' @echo ' IN > $(SHAREDIR)/build.zsh/library.zsh'
$(Q)mkdir -p '$(DESTDIR)$(SHAREDIR)/build.zsh' $(Q)mkdir -p '$(DESTDIR)$(SHAREDIR)/build.zsh'
$(Q)install -m0755 build/library.zsh $(DESTDIR)$(SHAREDIR)/build.zsh/library.zsh $(Q)install -m0755 build/library.zsh $(DESTDIR)$(SHAREDIR)/build.zsh/library.zsh
build/library.zsh.clean: build/library.zsh.clean:
build/library.zsh.uninstall: build/library.zsh.uninstall:
@echo ' [RM] $(SHAREDIR)/build.zsh/library.zsh' @echo ' RM > $(SHAREDIR)/build.zsh/library.zsh'
$(Q)rm -f '$(DESTDIR)$(SHAREDIR)/build.zsh/library.zsh' $(Q)rm -f '$(DESTDIR)$(SHAREDIR)/build.zsh/library.zsh'
build/moon.zsh: build/moon.zsh:
build/moon.zsh.install: build/moon.zsh build/moon.zsh.install: build/moon.zsh
@echo ' [IN] $(SHAREDIR)/build.zsh/moon.zsh' @echo ' IN > $(SHAREDIR)/build.zsh/moon.zsh'
$(Q)mkdir -p '$(DESTDIR)$(SHAREDIR)/build.zsh' $(Q)mkdir -p '$(DESTDIR)$(SHAREDIR)/build.zsh'
$(Q)install -m0755 build/moon.zsh $(DESTDIR)$(SHAREDIR)/build.zsh/moon.zsh $(Q)install -m0755 build/moon.zsh $(DESTDIR)$(SHAREDIR)/build.zsh/moon.zsh
build/moon.zsh.clean: build/moon.zsh.clean:
build/moon.zsh.uninstall: build/moon.zsh.uninstall:
@echo ' [RM] $(SHAREDIR)/build.zsh/moon.zsh' @echo ' RM > $(SHAREDIR)/build.zsh/moon.zsh'
$(Q)rm -f '$(DESTDIR)$(SHAREDIR)/build.zsh/moon.zsh' $(Q)rm -f '$(DESTDIR)$(SHAREDIR)/build.zsh/moon.zsh'
build/ofile.zsh: build/ofile.zsh:
build/ofile.zsh.install: build/ofile.zsh build/ofile.zsh.install: build/ofile.zsh
@echo ' [IN] $(SHAREDIR)/build.zsh/ofile.zsh' @echo ' IN > $(SHAREDIR)/build.zsh/ofile.zsh'
$(Q)mkdir -p '$(DESTDIR)$(SHAREDIR)/build.zsh' $(Q)mkdir -p '$(DESTDIR)$(SHAREDIR)/build.zsh'
$(Q)install -m0755 build/ofile.zsh $(DESTDIR)$(SHAREDIR)/build.zsh/ofile.zsh $(Q)install -m0755 build/ofile.zsh $(DESTDIR)$(SHAREDIR)/build.zsh/ofile.zsh
build/ofile.zsh.clean: build/ofile.zsh.clean:
build/ofile.zsh.uninstall: build/ofile.zsh.uninstall:
@echo ' [RM] $(SHAREDIR)/build.zsh/ofile.zsh' @echo ' RM > $(SHAREDIR)/build.zsh/ofile.zsh'
$(Q)rm -f '$(DESTDIR)$(SHAREDIR)/build.zsh/ofile.zsh' $(Q)rm -f '$(DESTDIR)$(SHAREDIR)/build.zsh/ofile.zsh'
build/script.zsh: build/script.zsh:
build/script.zsh.install: build/script.zsh build/script.zsh.install: build/script.zsh
@echo ' [IN] $(SHAREDIR)/build.zsh/script.zsh' @echo ' IN > $(SHAREDIR)/build.zsh/script.zsh'
$(Q)mkdir -p '$(DESTDIR)$(SHAREDIR)/build.zsh' $(Q)mkdir -p '$(DESTDIR)$(SHAREDIR)/build.zsh'
$(Q)install -m0755 build/script.zsh $(DESTDIR)$(SHAREDIR)/build.zsh/script.zsh $(Q)install -m0755 build/script.zsh $(DESTDIR)$(SHAREDIR)/build.zsh/script.zsh
build/script.zsh.clean: build/script.zsh.clean:
build/script.zsh.uninstall: build/script.zsh.uninstall:
@echo ' [RM] $(SHAREDIR)/build.zsh/script.zsh' @echo ' RM > $(SHAREDIR)/build.zsh/script.zsh'
$(Q)rm -f '$(DESTDIR)$(SHAREDIR)/build.zsh/script.zsh' $(Q)rm -f '$(DESTDIR)$(SHAREDIR)/build.zsh/script.zsh'
build/sharedlib.zsh: build/sharedlib.zsh:
build/sharedlib.zsh.install: build/sharedlib.zsh build/sharedlib.zsh.install: build/sharedlib.zsh
@echo ' [IN] $(SHAREDIR)/build.zsh/sharedlib.zsh' @echo ' IN > $(SHAREDIR)/build.zsh/sharedlib.zsh'
$(Q)mkdir -p '$(DESTDIR)$(SHAREDIR)/build.zsh' $(Q)mkdir -p '$(DESTDIR)$(SHAREDIR)/build.zsh'
$(Q)install -m0755 build/sharedlib.zsh $(DESTDIR)$(SHAREDIR)/build.zsh/sharedlib.zsh $(Q)install -m0755 build/sharedlib.zsh $(DESTDIR)$(SHAREDIR)/build.zsh/sharedlib.zsh
build/sharedlib.zsh.clean: build/sharedlib.zsh.clean:
build/sharedlib.zsh.uninstall: build/sharedlib.zsh.uninstall:
@echo ' [RM] $(SHAREDIR)/build.zsh/sharedlib.zsh' @echo ' RM > $(SHAREDIR)/build.zsh/sharedlib.zsh'
$(Q)rm -f '$(DESTDIR)$(SHAREDIR)/build.zsh/sharedlib.zsh' $(Q)rm -f '$(DESTDIR)$(SHAREDIR)/build.zsh/sharedlib.zsh'
build/staticlib.zsh: build/staticlib.zsh:
build/staticlib.zsh.install: build/staticlib.zsh build/staticlib.zsh.install: build/staticlib.zsh
@echo ' [IN] $(SHAREDIR)/build.zsh/staticlib.zsh' @echo ' IN > $(SHAREDIR)/build.zsh/staticlib.zsh'
$(Q)mkdir -p '$(DESTDIR)$(SHAREDIR)/build.zsh' $(Q)mkdir -p '$(DESTDIR)$(SHAREDIR)/build.zsh'
$(Q)install -m0755 build/staticlib.zsh $(DESTDIR)$(SHAREDIR)/build.zsh/staticlib.zsh $(Q)install -m0755 build/staticlib.zsh $(DESTDIR)$(SHAREDIR)/build.zsh/staticlib.zsh
build/staticlib.zsh.clean: build/staticlib.zsh.clean:
build/staticlib.zsh.uninstall: build/staticlib.zsh.uninstall:
@echo ' [RM] $(SHAREDIR)/build.zsh/staticlib.zsh' @echo ' RM > $(SHAREDIR)/build.zsh/staticlib.zsh'
$(Q)rm -f '$(DESTDIR)$(SHAREDIR)/build.zsh/staticlib.zsh' $(Q)rm -f '$(DESTDIR)$(SHAREDIR)/build.zsh/staticlib.zsh'
$(DESTDIR)$(PREFIX): $(DESTDIR)$(PREFIX):
@echo ' [DIR] $(PREFIX)' @echo ' DIR > $(PREFIX)'
$(Q)mkdir -p $(DESTDIR)$(PREFIX) $(Q)mkdir -p $(DESTDIR)$(PREFIX)
$(DESTDIR)$(BINDIR): $(DESTDIR)$(BINDIR):
@echo ' [DIR] $(BINDIR)' @echo ' DIR > $(BINDIR)'
$(Q)mkdir -p $(DESTDIR)$(BINDIR) $(Q)mkdir -p $(DESTDIR)$(BINDIR)
$(DESTDIR)$(LIBDIR): $(DESTDIR)$(LIBDIR):
@echo ' [DIR] $(LIBDIR)' @echo ' DIR > $(LIBDIR)'
$(Q)mkdir -p $(DESTDIR)$(LIBDIR) $(Q)mkdir -p $(DESTDIR)$(LIBDIR)
$(DESTDIR)$(SHAREDIR): $(DESTDIR)$(SHAREDIR):
@echo ' [DIR] $(SHAREDIR)' @echo ' DIR > $(SHAREDIR)'
$(Q)mkdir -p $(DESTDIR)$(SHAREDIR) $(Q)mkdir -p $(DESTDIR)$(SHAREDIR)
$(DESTDIR)$(INCLUDEDIR): $(DESTDIR)$(INCLUDEDIR):
@echo ' [DIR] $(INCLUDEDIR)' @echo ' DIR > $(INCLUDEDIR)'
$(Q)mkdir -p $(DESTDIR)$(INCLUDEDIR) $(Q)mkdir -p $(DESTDIR)$(INCLUDEDIR)
install: subdirs.install build.zsh.install build/binary.zsh.install build/crystal.zsh.install build/library.zsh.install build/moon.zsh.install build/ofile.zsh.install build/script.zsh.install build/sharedlib.zsh.install build/staticlib.zsh.install install: subdirs.install build.zsh.install build/binary.zsh.install build/crystal.zsh.install build/library.zsh.install build/moon.zsh.install build/ofile.zsh.install build/script.zsh.install build/sharedlib.zsh.install build/staticlib.zsh.install
@: @:
@ -183,7 +184,7 @@ distdir:
dist-gz: $(PACKAGE)-$(VERSION).tar.gz dist-gz: $(PACKAGE)-$(VERSION).tar.gz
$(PACKAGE)-$(VERSION).tar.gz: distdir $(PACKAGE)-$(VERSION).tar.gz: distdir
@echo ' [TAR] $(PACKAGE)-$(VERSION).tar.gz' @echo ' TAR > $(PACKAGE)-$(VERSION).tar.gz'
$(Q)tar czf $(PACKAGE)-$(VERSION).tar.gz \ $(Q)tar czf $(PACKAGE)-$(VERSION).tar.gz \
$(PACKAGE)-$(VERSION)/build/binary.zsh \ $(PACKAGE)-$(VERSION)/build/binary.zsh \
$(PACKAGE)-$(VERSION)/build/crystal.zsh \ $(PACKAGE)-$(VERSION)/build/crystal.zsh \
@ -193,12 +194,13 @@ $(PACKAGE)-$(VERSION).tar.gz: distdir
$(PACKAGE)-$(VERSION)/build/script.zsh \ $(PACKAGE)-$(VERSION)/build/script.zsh \
$(PACKAGE)-$(VERSION)/build/sharedlib.zsh \ $(PACKAGE)-$(VERSION)/build/sharedlib.zsh \
$(PACKAGE)-$(VERSION)/build/staticlib.zsh \ $(PACKAGE)-$(VERSION)/build/staticlib.zsh \
$(PACKAGE)-$(VERSION)/build.zsh.in \
$(PACKAGE)-$(VERSION)/project.zsh \ $(PACKAGE)-$(VERSION)/project.zsh \
$(PACKAGE)-$(VERSION)/Makefile $(PACKAGE)-$(VERSION)/Makefile
dist-xz: $(PACKAGE)-$(VERSION).tar.xz dist-xz: $(PACKAGE)-$(VERSION).tar.xz
$(PACKAGE)-$(VERSION).tar.xz: distdir $(PACKAGE)-$(VERSION).tar.xz: distdir
@echo ' [TAR] $(PACKAGE)-$(VERSION).tar.xz' @echo ' TAR > $(PACKAGE)-$(VERSION).tar.xz'
$(Q)tar cJf $(PACKAGE)-$(VERSION).tar.xz \ $(Q)tar cJf $(PACKAGE)-$(VERSION).tar.xz \
$(PACKAGE)-$(VERSION)/build/binary.zsh \ $(PACKAGE)-$(VERSION)/build/binary.zsh \
$(PACKAGE)-$(VERSION)/build/crystal.zsh \ $(PACKAGE)-$(VERSION)/build/crystal.zsh \
@ -208,12 +210,13 @@ $(PACKAGE)-$(VERSION).tar.xz: distdir
$(PACKAGE)-$(VERSION)/build/script.zsh \ $(PACKAGE)-$(VERSION)/build/script.zsh \
$(PACKAGE)-$(VERSION)/build/sharedlib.zsh \ $(PACKAGE)-$(VERSION)/build/sharedlib.zsh \
$(PACKAGE)-$(VERSION)/build/staticlib.zsh \ $(PACKAGE)-$(VERSION)/build/staticlib.zsh \
$(PACKAGE)-$(VERSION)/build.zsh.in \
$(PACKAGE)-$(VERSION)/project.zsh \ $(PACKAGE)-$(VERSION)/project.zsh \
$(PACKAGE)-$(VERSION)/Makefile $(PACKAGE)-$(VERSION)/Makefile
dist-bz2: $(PACKAGE)-$(VERSION).tar.bz2 dist-bz2: $(PACKAGE)-$(VERSION).tar.bz2
$(PACKAGE)-$(VERSION).tar.bz2: distdir $(PACKAGE)-$(VERSION).tar.bz2: distdir
@echo ' [TAR] $(PACKAGE)-$(VERSION).tar.bz2' @echo ' TAR > $(PACKAGE)-$(VERSION).tar.bz2'
$(Q)tar cjf $(PACKAGE)-$(VERSION).tar.bz2 \ $(Q)tar cjf $(PACKAGE)-$(VERSION).tar.bz2 \
$(PACKAGE)-$(VERSION)/build/binary.zsh \ $(PACKAGE)-$(VERSION)/build/binary.zsh \
$(PACKAGE)-$(VERSION)/build/crystal.zsh \ $(PACKAGE)-$(VERSION)/build/crystal.zsh \
@ -223,39 +226,48 @@ $(PACKAGE)-$(VERSION).tar.bz2: distdir
$(PACKAGE)-$(VERSION)/build/script.zsh \ $(PACKAGE)-$(VERSION)/build/script.zsh \
$(PACKAGE)-$(VERSION)/build/sharedlib.zsh \ $(PACKAGE)-$(VERSION)/build/sharedlib.zsh \
$(PACKAGE)-$(VERSION)/build/staticlib.zsh \ $(PACKAGE)-$(VERSION)/build/staticlib.zsh \
$(PACKAGE)-$(VERSION)/build.zsh.in \
$(PACKAGE)-$(VERSION)/project.zsh \ $(PACKAGE)-$(VERSION)/project.zsh \
$(PACKAGE)-$(VERSION)/Makefile $(PACKAGE)-$(VERSION)/Makefile
help: help:
@echo ' :: build_zsh-0.2.1' @echo ' :: build_zsh-0.2.1'
@echo '' @echo ''
@echo 'Generic targets:' @echo 'Generic targets:'
@echo ' - help Prints this help message.' @echo ' - help Prints this help message.'
@echo ' - all Builds all targets.' @echo ' - all Builds all targets.'
@echo ' - dist Creates tarballs of the files of the project.' @echo ' - dist Creates tarballs of the files of the project.'
@echo ' - install Installs the project.' @echo ' - install Installs the project.'
@echo ' - clean Removes compiled files.' @echo ' - clean Removes compiled files.'
@echo ' - uninstall Deinstalls the project.' @echo ' - uninstall Deinstalls the project.'
@echo '' @echo ''
@echo 'CLI-modifiable variables:' @echo 'CLI-modifiable variables:'
@echo ' - CC ${CC}' @echo ' - CC ${CC}'
@echo ' - CFLAGS ${CFLAGS}' @echo ' - CFLAGS ${CFLAGS}'
@echo ' - LDFLAGS ${LDFLAGS}' @echo ' - LDFLAGS ${LDFLAGS}'
@echo ' - DESTDIR ${DESTDIR}' @echo ' - DESTDIR ${DESTDIR}'
@echo ' - PREFIX ${PREFIX}' @echo ' - PREFIX ${PREFIX}'
@echo ' - BINDIR ${BINDIR}' @echo ' - BINDIR ${BINDIR}'
@echo ' - LIBDIR ${LIBDIR}' @echo ' - LIBDIR ${LIBDIR}'
@echo ' - SHAREDIR ${SHAREDIR}' @echo ' - SHAREDIR ${SHAREDIR}'
@echo ' - INCLUDEDIR ${INCLUDEDIR}' @echo ' - INCLUDEDIR ${INCLUDEDIR}'
@echo '' @echo ''
@echo 'Project targets: ' @echo 'Project targets: '
@echo ' - build.zsh script' @echo ' - build.zsh script'
@echo ' - build/binary.zsh script'
@echo ' - build/crystal.zsh script'
@echo ' - build/library.zsh script'
@echo ' - build/moon.zsh script'
@echo ' - build/ofile.zsh script'
@echo ' - build/script.zsh script'
@echo ' - build/sharedlib.zsh script'
@echo ' - build/staticlib.zsh script'
@echo '' @echo ''
@echo 'Makefile options:' @echo 'Makefile options:'
@echo ' - gnu: true' @echo ' - gnu: false'
@echo ' - colors: true' @echo ' - colors: false'
@echo '' @echo ''
@echo 'Rebuild the Makefile with:' @echo 'Rebuild the Makefile with:'
@echo ' zsh ./build.zsh -c -g' @echo ' zsh ./build.zsh'
.PHONY: all subdirs clean distclean dist install uninstall help .PHONY: all subdirs clean distclean dist install uninstall help

View File

@ -34,35 +34,35 @@ function write {
} }
function CC { function CC {
echo "${fg_bold[blue]} [CC] ${fg_bold[white]}$@${reset_color}" echo "${fg_bold[blue]} CC > ${fg_bold[white]}$@${reset_color}"
} }
function LD { function LD {
echo "${fg_bold[green]} [LD] ${fg_bold[white]}$@${reset_color}" echo "${fg_bold[green]} LD > ${fg_bold[white]}$@${reset_color}"
} }
function IN { function IN {
echo "${fg_bold[red]} [IN] ${fg_bold[white]}$@${reset_color}" echo "${fg_bold[red]} IN > ${fg_bold[white]}$@${reset_color}"
} }
function LN { function LN {
echo "${fg_bold[yellow]} [LN] ${fg_bold[white]}$@${reset_color}" echo "${fg_bold[yellow]} LN > ${fg_bold[white]}$@${reset_color}"
} }
function RM { function RM {
echo "${fg_bold[white]} [RM] ${fg_bold[white]}$@${reset_color}" echo "${fg_bold[white]} RM > ${fg_bold[white]}$@${reset_color}"
} }
function SED { function SED {
echo "${fg_bold[green]} [SED] ${fg_bold[white]}$@${reset_color}" echo "${fg_bold[green]} SED > ${fg_bold[white]}$@${reset_color}"
} }
function DIR { function DIR {
echo "${fg_bold[magenta]} [DIR] ${fg_bold[white]}$@${reset_color}" echo "${fg_bold[magenta]} DIR > ${fg_bold[white]}$@${reset_color}"
} }
function TAR { function TAR {
echo "${fg_bold[yellow]} [TAR] ${fg_bold[white]}$@${reset_color}" echo "${fg_bold[yellow]} TAR > ${fg_bold[white]}$@${reset_color}"
} }
# Generic helpers # Generic helpers