Line # Revision Author
1 5894 gradha # Makefile for web generation.
2 # Note that from this line on to the first include we are only defining
3 # variables. Why? Well, to allow you customize the web generation. Just
4 # create a Makefile.local file which overrides the variables declared
5 # here and you are done, this local file won't be updated by cvs.
6
7 5943 gradha # You might want to change this to point to your python binary. You can
8 # use a full path if needed.
9 PYTHON_EXEC = python
10
11 6013 gradha WEBMAKE = $(PYTHON_EXEC) scripts/webmake.py
12 6294 gradha MIRROR_PY = $(PYTHON_EXEC) scripts/mirror.py
13 6013 gradha EXTERNAL_DEP_HELPER = $(PYTHON_EXEC) scripts/external_dep_helper.py
14 5943 gradha MAKEDOC = external/makedoc.exe
15 6230 gradha MAKEDOC_SRC = $(wildcard external/makedoc/m*.c)
16 5915 gradha # Don't want to rebuild makedoc? Set MAKEDOC_DEP empty in Makefile.local
17 5912 gradha MAKEDOC_DEP = $(MAKEDOC)
18 5911 gradha EXTERNAL_TEMPFILE = external/temp
19 6296 gradha MIRROR_TIMESTAMP = external/mirror_timestamp
20 6315 gradha MIRROR_DATA = external/binary-files.txt
21 6013 gradha RM = $(PYTHON_EXEC) scripts/rm.py
22 6346 gradha USELESS_SLEEP = # this is needed by sourceforge's make, don't touch: hack
23 5830 gradha
24 5855 gradha OUTDIR = out/
25 SRCDIR = src/
26 5867 elias STDOUTPUT = $@
27
28 5894 gradha # This line indicates which languages will be generated. At the moment
29 5915 gradha # available languages are en:es:de. If you override this variable in
30 # Makefile.local and delete (or add) some langcode, please activate in
31 # allegro.ini the missing codes' substitution rules if needed.
32 6015 gradha # Languages are in form <langcode>,<charset>, but if you omit the
33 # charset, iso-8859-1 will be used.
34 7279 elias GENERATE_LANGUAGES = en:es:de,utf8:fr:ko,euc-kr:pl,iso-8859-2:it:cs,iso-8859-2
35 5894 gradha
36 5915 gradha # The following is similar to GENERATE_LANGUAGES, but for the online
37 # documentation. Don't leave blank: if you don't want to generate _any_
38 # online documentation, just leave ':'. Again, remember to put in
39 # allegro.ini the missing codes' substitution rules if needed.
40 6468 gradha GENERATE_ONLINE_DOCS = en
41 5915 gradha
42 7002 gradha # Next lines indicates which languages will have translation
43 # statistics generated for. Usually this is changed only by the
44 # webmaster, depending on which translations are active.
45 7266 gradha #
46 # Note: obsolete, now the find_missing_translations.py script
47 # is used.
48 7070 gradha STAT_LANGS = es de fr cs
49 7002 gradha
50 5868 gradha # in the following included file you can override global settings
51 5849 gradha -include Makefile.local
52
53 5894 gradha # General rules. From here on you shouldn't touch anything
54 5911 gradha .PHONY: all generate dep depend clean distclean
55 5915 gradha DEP_INFO = dependency_info
56 5855 gradha
57 5894 gradha all: generate
58 5885 gradha
59 6708 ebotcazou -include $(DEP_INFO)
60 5830 gradha
61 5911 gradha generate: $(EXTERNAL_DEPS) $(DEPS)
62 5894 gradha
63 5840 gradha dep: depend
64
65 depend:
66 6274 gradha @$(RM) $(DEP_INFO)
67 5840 gradha
68 5915 gradha $(DEP_INFO):
69 6296 gradha $(WEBMAKE) --output=$(OUTDIR) --localize=$(GENERATE_LANGUAGES) --depend --mirror-timestamp=$(MIRROR_TIMESTAMP) src/*.html > $(DEP_INFO)
70 $(EXTERNAL_DEP_HELPER) --localize=$(GENERATE_LANGUAGES) --source=external --destination=data/external >> $(DEP_INFO)
71 7640 gradha $(EXTERNAL_DEP_HELPER) --localize=$(GENERATE_ONLINE_DOCS) --source=external --api=out/latestdocs >> $(DEP_INFO)
72 $(EXTERNAL_DEP_HELPER) --localize=$(GENERATE_ONLINE_DOCS) --source=external/stable --stable-api=out/stabledocs >> $(DEP_INFO)
73 7641 gradha $(EXTERNAL_DEP_HELPER) --redirect=out/onlinedocs >> $(DEP_INFO)
74 6346 gradha $(USELESS_SLEEP)
75 5840 gradha
76 5943 gradha clean: $(AUTOMATIC_CLEANUP_FILES)
77 $(RM) $(DEP_INFO) $(EXTERNAL_TEMPFILE)
78 5840 gradha
79 5911 gradha distclean: clean
80 5943 gradha $(RM) *.pyc
81 5911 gradha
82 5912 gradha $(MAKEDOC_DEP): $(MAKEDOC_SRC)
83 gcc -o $(MAKEDOC_DEP) -O2 -s $(MAKEDOC_SRC)
84 5911 gradha
85 6294 gradha mirror:
86 6315 gradha $(MIRROR_PY) --configuration=allegro.ini --data=$(MIRROR_DATA) --output-dir=$(OUTDIR) --timestamp=$(MIRROR_TIMESTAMP)
87 6295 gradha
88 fake-mirror:
89 6315 gradha $(MIRROR_PY) --fake --configuration=allegro.ini --data=$(MIRROR_DATA) --output-dir=$(OUTDIR) --timestamp=$(MIRROR_TIMESTAMP)
90 6296 gradha
91 6394 gradha translation-statistics:
92 7002 gradha $(RM) -R stats statistics statistics.*
93 make -C . depend OUTDIR=stats WEBMAKE="$(PYTHON_EXEC) scripts/webmake.py -w statistics"
94 make -C . OUTDIR=stats WEBMAKE="$(PYTHON_EXEC) scripts/webmake.py -w statistics"
95 @for code in $(STAT_LANGS); do \
96 cat statistics|grep $$code:|sort|uniq> $(OUTDIR)/statistics.$$code; \
97 chown .alleg $(OUTDIR)/statistics.$$code; chmod 664 $(OUTDIR)/statistics.$$code; \
98 6394 gradha done
99 7144 gradha $(RM) -R stats statistics $(DEP_INFO)
100 6928 gradha
101 whoareyou:
102 @echo "It's me, the white rabbit."
103 6930 gradha
104 7142 gradha RESTDOCS=instructions sf_cron_update_web sf_cron_author_statistics_update \
105 7243 gradha sf_cron_translation_stat
106 7142 gradha
107 restdocs: $(addprefix docs/,$(addsuffix .html,$(RESTDOCS)))
108 @echo Done
109
110 docs/%.html: docs/%.txt
111 rest2html --embed-stylesheet --stylesheet-path docs/style.css $< > $@