File: Makefile

package info (click to toggle)
pysolfc 3.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 94,860 kB
  • sloc: python: 82,020; tcl: 4,529; makefile: 66; sh: 57; perl: 48
file content (72 lines) | stat: -rw-r--r-- 2,071 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Makefile for PySolFC

ifeq ($(OS),Windows_NT)
	path_sep = ;
else
	path_sep = :
endif
export PYTHONPATH := $(PYTHONPATH)$(path_sep)$(CURDIR)

.PHONY: all install dist rpm all_games_html rules pot mo pretest test runtest

all:
	@echo "No default target"

install:
	python3 setup.py install

dist: all_games_html rules mo
	python3 setup.py sdist

rpm: all_games_html rules mo
	python3 setup.py bdist_rpm

DOCS_DIR = docs
HTML_DIR = data/html
ALL_GAMES_HTML_BASE = all_games.html
ALL_GAMES_HTML = $(HTML_DIR)/$(ALL_GAMES_HTML_BASE)
ALL_GAMES_HTML__FOR_WEBSITE = $(DOCS_DIR)/$(ALL_GAMES_HTML_BASE)
all_games_html: $(ALL_GAMES_HTML)

$(ALL_GAMES_HTML) $(ALL_GAMES_HTML__FOR_WEBSITE): rules
	cd $(HTML_DIR) && $(CURDIR)/scripts/all_games.py html id rules > $(ALL_GAMES_HTML_BASE)
	./scripts/all_games.py html id doc/rules bare > $(ALL_GAMES_HTML__FOR_WEBSITE)

rules:
	cd html-src && ./gen-html.py
	cp -r html-src/images html-src/html
	rm -rf data/html
	mv html-src/html data

pot:
	./scripts/all_games.py gettext > po/games.pot
	xgettext --keyword=n_ --add-comments=TRANSLATORS: -o po/pysol.pot \
		pysollib/*.py pysollib/*/*.py pysollib/*/*/*.py data/pysolfc.glade
	set -e; \
	for lng in de fr pl it ru pt_BR; do \
		msgmerge --update --quiet --backup=none po/$${lng}_pysol.po po/pysol.pot; \
		msgmerge --update --quiet --backup=none po/$${lng}_games.po po/games.pot; \
	done

mo:
	set -e; \
	for lang in de fr pl it ru pt_BR; do \
		mkdir -p locale/$${lang}/LC_MESSAGES; \
		msgcat --use-first po/$${lang}_games.po po/$${lang}_pysol.po > po/$${lang}.po; \
		msgfmt --check -o locale/$${lang}/LC_MESSAGES/pysol.mo po/$${lang}.po; \
	done

pretest:
	rm -f tests/individually-importing/*.py tests/unit-generated/*.py # To avoid stray files
	python3 scripts/gen_individual_importing_tests.py

TEST_ENV_PATH = $(CURDIR)$(path_sep)$(CURDIR)/tests/lib
TEST_FILES = tests/style/*.t tests/t/*.py tests/individually-importing/*.py

test runtest: export PERL5LIB := $(PERL5LIB)$(path_sep)$(TEST_ENV_PATH)

test: pretest
	prove $(TEST_FILES)

runtest: pretest
	runprove $(TEST_FILES)