Skip to content

Commit 06aeea9

Browse files
committed
make: split off license extraction
As an intermediate measure improving build times with multiple jobs until the toplevel Makefile can properly handle parallelism.
1 parent 4b2c538 commit 06aeea9

File tree

2 files changed

+42
-30
lines changed

2 files changed

+42
-30
lines changed

Makefile

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -205,36 +205,9 @@ dist/js/subtitles-octopus.js: dist/license/all src/subtitles-octopus.js
205205
mkdir -p dist/js
206206
awk '1 {print "// "$$0}' dist/license/all | cat - src/subtitles-octopus.js > $@
207207

208-
LIB_LICENSES := brotli expat freetype fribidi fontconfig harfbuzz libass
209-
LIB_LICENSES_FINDOPT_brotli := -path ./research -prune -false -o ! -path ./js/decode.min.js
210-
LIB_LICENSES_FINDOPT_expat := -path ./expat/fuzz -prune -false -o
211-
LIB_LICENSES_FINDOPT_freetype := -path ./src/tools -prune -false -o
212-
LIB_LICENSES_FINDOPT_fribidi := -path ./bin -prune -false -o
213-
LIB_LICENSES_FINDOPT_harfbuzz := -path ./test -prune -false -o
214-
215-
$(addprefix dist/license/, $(LIB_LICENSES)): dist/license/%: .git/modules/lib/%/HEAD build/license_extract.sh build/license_defaults
216-
@mkdir -p dist/license
217-
(cd "lib/$*" && FINDOPTS="$(LIB_LICENSES_FINDOPT_$*)" \
218-
../../build/license_extract.sh ../../build/license_defaults "$*" .) > $@
219-
220-
dist/license/subtitlesoctopus: .git/HEAD build/license_extract.sh
221-
@mkdir -p dist/license
222-
build/license_extract.sh build/license_defaults subtitlesoctopus src > dist/license/subtitlesoctopus
223-
224-
dist/license/all: dist/license/subtitlesoctopus $(addprefix dist/license/, $(LIB_LICENSES)) build/license_fullnotice build/license_lint.awk
225-
@echo "# The following lists all copyright notices and licenses for the" > dist/license/all
226-
@echo "# work contained in JavascriptSubtitlesOctopus per project." >> dist/license/all
227-
@echo "" >> dist/license/all
228-
229-
@echo "Concatenate extracted license info..."
230-
@$(foreach LIB_PROJ, subtitlesoctopus $(LIB_LICENSES), \
231-
echo "# Project: $(LIB_PROJ)" >> dist/license/all && \
232-
cat dist/license/$(LIB_PROJ) >> dist/license/all && \
233-
) :
234-
235-
mv dist/license/all dist/license/all.tmp
236-
build/license_lint.awk dist/license/all.tmp build/license_fullnotice
237-
cat dist/license/all.tmp build/license_fullnotice > dist/license/all
208+
dist/license/all:
209+
@#FIXME: allow -j in toplevel Makefile and reintegrate licence extraction into this file
210+
make -j "$$(nproc)" -f Makefile_licence all
238211

239212
dist/js/COPYRIGHT: dist/license/all
240213
cp "$<" "$@"

Makefile_licence

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# FIXME: temporarily split Makefile to parallelise licence info extraction
2+
# once -j can be passed to the toplevel Makefile this should be moved
3+
# back into the main Makefile
4+
5+
all: dist/license/all
6+
7+
LIB_LICENSES := brotli expat freetype fribidi fontconfig harfbuzz libass
8+
LIB_LICENSES_FINDOPT_brotli := -path ./research -prune -false -o ! -path ./js/decode.min.js
9+
LIB_LICENSES_FINDOPT_expat := -path ./expat/fuzz -prune -false -o
10+
LIB_LICENSES_FINDOPT_freetype := -path ./src/tools -prune -false -o
11+
LIB_LICENSES_FINDOPT_fribidi := -path ./bin -prune -false -o
12+
LIB_LICENSES_FINDOPT_harfbuzz := -path ./test -prune -false -o
13+
14+
$(addprefix dist/license/, $(LIB_LICENSES)): dist/license/%: .git/modules/lib/%/HEAD build/license_extract.sh build/license_defaults
15+
@mkdir -p dist/license
16+
(cd "lib/$*" && FINDOPTS="$(LIB_LICENSES_FINDOPT_$*)" \
17+
../../build/license_extract.sh ../../build/license_defaults "$*" .) > $@
18+
19+
dist/license/subtitlesoctopus: .git/HEAD build/license_extract.sh
20+
@mkdir -p dist/license
21+
build/license_extract.sh build/license_defaults subtitlesoctopus src > dist/license/subtitlesoctopus
22+
23+
dist/license/all: dist/license/subtitlesoctopus $(addprefix dist/license/, $(LIB_LICENSES)) build/license_fullnotice build/license_lint.awk
24+
@echo "# The following lists all copyright notices and licenses for the" > dist/license/all
25+
@echo "# work contained in JavascriptSubtitlesOctopus per project." >> dist/license/all
26+
@echo "" >> dist/license/all
27+
28+
@echo "Concatenate extracted license info..."
29+
@$(foreach LIB_PROJ, subtitlesoctopus $(LIB_LICENSES), \
30+
echo "# Project: $(LIB_PROJ)" >> dist/license/all && \
31+
cat dist/license/$(LIB_PROJ) >> dist/license/all && \
32+
) :
33+
34+
mv dist/license/all dist/license/all.tmp
35+
build/license_lint.awk dist/license/all.tmp build/license_fullnotice
36+
cat dist/license/all.tmp build/license_fullnotice > dist/license/all
37+
38+
dist/js/COPYRIGHT: dist/license/all
39+
cp "$<" "$@"

0 commit comments

Comments
 (0)