Git fork

Makefile: extract script to generate gitweb.js

Similar to the preceding commit, also extract the script to generate the
"gitweb.js" file. While the logic itself is trivial, it helps us avoid
duplication of logic across build systems and ensures that the build
systems will remain in sync with each other in case the logic ever needs
to change.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Patrick Steinhardt and committed by
Junio C Hamano
19d8fe7d d2507bbb

+14 -1
+2 -1
gitweb/Makefile
··· 115 115 $(MAK_DIR_GITWEB)generate-gitweb-cgi.sh $(MAK_DIR_GITWEB)/GITWEB-BUILD-OPTIONS ./GIT-VERSION-FILE $< $@+ && \ 116 116 mv $@+ $@ 117 117 118 + $(MAK_DIR_GITWEB)static/gitweb.js: $(MAK_DIR_GITWEB)generate-gitweb-js.sh 118 119 $(MAK_DIR_GITWEB)static/gitweb.js: $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_JSLIB_FILES)) 119 120 $(QUIET_GEN)$(RM) $@ $@+ && \ 120 - cat $^ >$@+ && \ 121 + $(MAK_DIR_GITWEB)generate-gitweb-js.sh $@+ $^ && \ 121 122 mv $@+ $@ 122 123 123 124 ### Installation rules
+12
gitweb/generate-gitweb-js.sh
··· 1 + #!/bin/sh 2 + 3 + if test "$#" -lt 2 4 + then 5 + echo >&2 "USAGE: $0 <OUTPUT> <INPUT>..." 6 + exit 1 7 + fi 8 + 9 + OUTPUT="$1" 10 + shift 11 + 12 + cat "$@" >"$OUTPUT"