Skip to content

Commit 19d8fe7

Browse files
pks-tgitster
authored andcommitted
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>
1 parent d2507bb commit 19d8fe7

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

gitweb/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,10 @@ $(MAK_DIR_GITWEB)gitweb.cgi: $(MAK_DIR_GITWEB)gitweb.perl
115115
$(MAK_DIR_GITWEB)generate-gitweb-cgi.sh $(MAK_DIR_GITWEB)/GITWEB-BUILD-OPTIONS ./GIT-VERSION-FILE $< $@+ && \
116116
mv $@+ $@
117117

118+
$(MAK_DIR_GITWEB)static/gitweb.js: $(MAK_DIR_GITWEB)generate-gitweb-js.sh
118119
$(MAK_DIR_GITWEB)static/gitweb.js: $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_JSLIB_FILES))
119120
$(QUIET_GEN)$(RM) $@ $@+ && \
120-
cat $^ >$@+ && \
121+
$(MAK_DIR_GITWEB)generate-gitweb-js.sh $@+ $^ && \
121122
mv $@+ $@
122123

123124
### Installation rules

gitweb/generate-gitweb-js.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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"

0 commit comments

Comments
 (0)