2015-07-21 09:21:13 +02:00
|
|
|
# In order to build a copy of Oddmuse with all the version numbers, use:
|
|
|
|
|
# make build. This creates modified copies of the files in the build
|
|
|
|
|
# subdirectory.
|
2003-03-27 23:38:22 +00:00
|
|
|
|
2012-04-24 00:49:27 +02:00
|
|
|
VERSION_NO=$(shell git describe --tags)
|
2015-10-14 12:21:06 +02:00
|
|
|
TRANSLATIONS=$(wildcard modules/translations/[a-z]*-utf8.pl$)
|
2004-01-30 13:45:33 +00:00
|
|
|
MODULES=$(wildcard modules/*.pl)
|
2012-07-18 18:34:57 +02:00
|
|
|
BUILD=build/wiki.pl $(foreach file, $(notdir $(MODULES)) $(notdir $(TRANSLATIONS)), build/$(file))
|
|
|
|
|
|
|
|
|
|
# PREPARE/BUILD: this creates copies of wiki.pl and all the modules
|
|
|
|
|
# and translations in the build subdirectory. These copies all contain
|
|
|
|
|
# a reference to the revision they were created from (git describe
|
|
|
|
|
# --tags).
|
|
|
|
|
|
|
|
|
|
prepare: build $(BUILD)
|
|
|
|
|
|
|
|
|
|
build:
|
|
|
|
|
mkdir -p build
|
|
|
|
|
|
2015-04-03 09:21:37 +02:00
|
|
|
clean:
|
|
|
|
|
rm -rf build
|
2015-12-19 11:53:12 +01:00
|
|
|
prove t/setup.pl
|
|
|
|
|
|
|
|
|
|
release:
|
2016-07-06 18:14:47 +02:00
|
|
|
perl stuff/release ~/oddmuse.org/releases 2.3.3
|
2015-04-03 09:21:37 +02:00
|
|
|
|
2012-07-18 18:34:57 +02:00
|
|
|
build/wiki.pl: wiki.pl
|
2016-06-16 09:43:08 +02:00
|
|
|
perl -lne "s/(\\\$$q->a\(\{-href=>'http:\/\/www.oddmuse.org\/'\}, 'Oddmuse'\))/\\\$$q->a({-href=>'http:\/\/git.savannah.gnu.org\/cgit\/oddmuse.git\/tag\/?id=$(VERSION_NO)'}, 'wiki.pl') . ' ($(VERSION_NO)), see ' . \$$1/; print" < $< > $@
|
2012-07-18 18:34:57 +02:00
|
|
|
|
|
|
|
|
build/%-utf8.pl: modules/translations/%-utf8.pl
|
2014-08-24 22:20:50 +02:00
|
|
|
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, 'translations\/', '$(VERSION_NO)')/; print" < $< > $@
|
2012-07-18 18:34:57 +02:00
|
|
|
|
2015-04-03 09:21:37 +02:00
|
|
|
build/national-%.pl: modules/translations/national-%.pl
|
|
|
|
|
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, 'translations\/', '$(VERSION_NO)')/; print" < $< > $@
|
|
|
|
|
|
|
|
|
|
build/month-names-%.pl: modules/translations/month-names-%.pl
|
|
|
|
|
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, 'translations\/', '$(VERSION_NO)')/; print" < $< > $@
|
|
|
|
|
|
2012-07-18 18:34:57 +02:00
|
|
|
# from: http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/namespaces.pl
|
|
|
|
|
# to: http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/namespaces.pl?id=2.1-11-gd4f1e27
|
|
|
|
|
|
|
|
|
|
build/%.pl: modules/%.pl
|
2014-08-24 22:20:50 +02:00
|
|
|
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, undef, '$(VERSION_NO)')/; print" < $< > $@
|
2012-07-18 18:34:57 +02:00
|
|
|
|
2015-09-30 17:35:02 +02:00
|
|
|
modules/translations/new-utf8.pl: wiki.pl $(MODULES)
|
|
|
|
|
cp $@ $@-old
|
|
|
|
|
perl stuff/oddtrans -l $@-old wiki.pl $(MODULES) > $@
|
|
|
|
|
rm -f $@-old
|
|
|
|
|
|
2014-08-24 12:31:15 +02:00
|
|
|
translations: $(TRANSLATIONS)
|
|
|
|
|
for f in $^; do \
|
|
|
|
|
echo updating $$f...; \
|
2015-09-30 17:35:02 +02:00
|
|
|
perl stuff/oddtrans -l $$f wiki.pl $(MODULES) > $$f-new && mv $$f-new $$f; \
|
2014-08-24 12:31:15 +02:00
|
|
|
done
|
2012-07-18 18:34:57 +02:00
|
|
|
|
2015-10-12 15:13:22 +02:00
|
|
|
# Running four jobs in parallel, but clean up data directories without
|
|
|
|
|
# race conditions!
|
|
|
|
|
|
2015-10-13 03:21:11 +03:00
|
|
|
jobs ?= 4
|
2015-05-01 19:33:14 +02:00
|
|
|
test:
|
2015-10-12 15:13:22 +02:00
|
|
|
prove t/setup.pl
|
2015-10-21 13:15:34 +03:00
|
|
|
prove --jobs=$(jobs) --state=slow,save t
|