.in scripts are somewhat better handled.

- Also, this build.zsh itself builds itself more nicely, with
	  nice building messages and stuff.
	- It also fixes the problem of on-system scripts that were…
	  well… kind of ignored. Yeah, I’m not working very seriously on
	  this…
master
Luka Vandervelden 2015-04-07 10:23:36 +02:00
parent 41b495b0e8
commit 3d91eac15d
3 changed files with 19 additions and 4 deletions

View File

@ -17,7 +17,11 @@ Q := @
all: build.zsh build/binary.zsh build/library.zsh build/ofile.zsh build/script.zsh build/sharedlib.zsh build/staticlib.zsh
build.zsh:
build.zsh: build.zsh.in
@echo ' [SED] build.zsh'
$(Q)sed -e 's&@LIBDIR@&$(LIBDIR)&;s&@BINDIR@&$(BINDIR)&;s&@SHAREDIR@&$(SHAREDIR)&;' 'build.zsh.in' > 'build.zsh'
$(Q)chmod +x 'build.zsh'
build.zsh.install: build.zsh
@echo ' [IN] $(BINDIR)/build.zsh'
@ -25,6 +29,8 @@ build.zsh.install: build.zsh
$(Q)install -m0755 build.zsh $(DESTDIR)$(BINDIR)/build.zsh
build.zsh.clean:
@echo ' [RM] build.zsh'
$(Q)rm -f build.zsh
build.zsh.uninstall:
@echo ' [RM] $(BINDIR)/build.zsh'

6
build.zsh → build.zsh.in Executable file → Normal file
View File

@ -53,6 +53,10 @@ function RM {
echo "${fg_bold[white]} [RM] ${fg_bold[white]}$@${reset_color}"
}
function SED {
echo "${fg_bold[green]} [SED] ${fg_bold[white]}$@${reset_color}"
}
function DIR {
echo "${fg_bold[magenta]} [DIR] ${fg_bold[white]}$@${reset_color}"
}
@ -166,7 +170,7 @@ function duplicated {
return 1
}
for dir in "@SHAREDIR@/build.zsh" build; do
for dir in "@SHAREDIR@/build.zsh" ./build; do
[[ -d "$dir" ]] && {
for i in "$dir"/*.zsh; do
. "$i"

View File

@ -4,8 +4,13 @@ function script.build {
if [[ -e "${target}.in" ]]; then
write " ${target}.in"
write "\tcat ${target}.in > ${target}"
write "\tchmod +x ${target}"
write "\t@echo '$(SED "${target}")'"
write -n "\t${Q}sed -e '"
write -n "s&@LIBDIR@&\$(LIBDIR)&;"
write -n "s&@BINDIR@&\$(BINDIR)&;"
write -n "s&@SHAREDIR@&\$(SHAREDIR)&;"
write "' '${target}.in' > '${target}'"
write "\t${Q}chmod +x '${target}'"
fi
write "\n"