source: trunk/devel/prepare.mak @ 1103

Last change on this file since 1103 was 1103, checked in by moo, 2 years ago

htdocs: fixed po2php. add translation for diagnosis

File size: 3.8 KB
Line 
1CTAGS=$(shell which ctags 2>/dev/null || which exuberant-ctags 2>/dev/null)
2AWK=$(shell which gawk 2>/dev/null || which awk 2>/dev/null)
3
4include devel/prepare.cfg
5
6.PHONY: dummy
7.PHONY: all
8all: xcache/xc_opcode_spec_def.h xc_const_string tags po
9
10.PHONY: clean
11clean: clean_xc_const_string clean_po
12    rm -f tags xcache/xc_opcode_spec_def.h
13
14.PHONY: clean_xc_const_string
15clean_xc_const_string:
16    rm -f xcache/xc_const_string_opcodes_php*.h
17
18.PHONY: xc_const_string
19xc_const_string: \
20    xcache/xc_const_string_opcodes_php4.x.h \
21    xcache/xc_const_string_opcodes_php5.0.h \
22    xcache/xc_const_string_opcodes_php5.1.h \
23    xcache/xc_const_string_opcodes_php5.3.h \
24    xcache/xc_const_string_opcodes_php5.4.h \
25    xcache/xc_const_string_opcodes_php6.x.h
26
27ifeq (${EA_DIR},)
28xcache/xc_opcode_spec_def.h: dummy
29    @echo "Skipped $@: EA_DIR not set"
30else
31xcache/xc_opcode_spec_def.h: ${EA_DIR}/opcodes.c
32    $(AWK) -f ./devel/gen_xc_opcode_spec.awk < "$<" > "$@".tmp
33    mv "$@".tmp "$@"
34endif
35
36ifeq (${PHP4_x_DIR},)
37xcache/xc_const_string_opcodes_php4.x.h: dummy
38    @echo "Skipped $@: PHP_4_x_DIR not set"
39else
40xcache/xc_const_string_opcodes_php4.x.h: ${PHP4_x_DIR}/Zend/zend_compile.h
41    $(AWK) -f ./devel/gen_const_string_opcodes.awk < "$<" > "$@.tmp"
42    mv "$@.tmp" "$@"
43endif
44
45ifeq (${PHP5_0_DIR},)
46xcache/xc_const_string_opcodes_php5.0.h: dummy
47    @echo "Skipped $@: PHP_5_0_DIR not set"
48else
49xcache/xc_const_string_opcodes_php5.0.h: ${PHP5_0_DIR}/Zend/zend_compile.h
50    $(AWK) -f ./devel/gen_const_string_opcodes.awk < "$<" > "$@.tmp"
51    mv "$@.tmp" "$@"
52endif
53
54ifeq (${PHP5_1_DIR},)
55xcache/xc_const_string_opcodes_php5.1.h: dummy
56    @echo "Skipped $@: PHP_5_1_DIR not set"
57else
58xcache/xc_const_string_opcodes_php5.1.h: ${PHP5_1_DIR}/Zend/zend_vm_def.h
59    $(AWK) -f ./devel/gen_const_string_opcodes.awk < "$<" > "$@.tmp"
60    mv "$@.tmp" "$@"
61endif
62
63ifeq (${PHP5_3_DIR},)
64xcache/xc_const_string_opcodes_php5.3.h: dummy
65    @echo "Skipped $@: PHP_5_3_DIR not set"
66else
67xcache/xc_const_string_opcodes_php5.3.h: ${PHP5_3_DIR}/Zend/zend_vm_def.h
68    $(AWK) -f ./devel/gen_const_string_opcodes.awk < "$<" > "$@.tmp"
69    mv "$@.tmp" "$@"
70endif
71
72ifeq (${PHP5_4_DIR},)
73xcache/xc_const_string_opcodes_php5.4.h: dummy
74    @echo "Skipped $@: PHP_5_4_DIR not set"
75else
76xcache/xc_const_string_opcodes_php5.4.h: ${PHP5_4_DIR}/Zend/zend_vm_def.h
77    $(AWK) -f ./devel/gen_const_string_opcodes.awk < "$<" > "$@.tmp"
78    mv "$@.tmp" "$@"
79endif
80
81ifeq (${PHP6_x_DIR},)
82xcache/xc_const_string_opcodes_php6.x.h: dummy
83    @echo "Skipped $@: PHP_6_x_DIR not set"
84else
85xcache/xc_const_string_opcodes_php6.x.h: ${PHP6_x_DIR}/Zend/zend_vm_def.h
86    $(AWK) -f ./devel/gen_const_string_opcodes.awk < "$<" > "$@.tmp"
87    mv "$@.tmp" "$@"
88endif
89
90ifeq (${PHP_DEVEL_DIR},)
91tags:
92    echo "* Making tags without php source files"
93    "$(CTAGS)" -R .
94else
95tags:
96    echo "* Making tags with ${PHP_DEVEL_DIR}"
97    "$(CTAGS)" -R . "${PHP_DEVEL_DIR}/main" "${PHP_DEVEL_DIR}/Zend" "${PHP_DEVEL_DIR}/TSRM" "${PHP_DEVEL_DIR}/ext/standard"
98endif
99
100.PHONY: po
101define htdocspo
102  po: \
103    htdocs/$(1)/lang/en.po \
104    htdocs/$(1)/lang/en.po-merged \
105    htdocs/$(1)/lang/zh-simplified.po-merged \
106    htdocs/$(1)/lang/zh-simplified.po \
107    htdocs/$(1)/lang/zh-traditional.po \
108    htdocs/$(1)/lang/zh-traditional.po-merged
109
110  htdocs/$(1)/lang/%.po-merged: htdocs/$(1)/lang/%.po htdocs/$(1)/lang/$(1).pot
111    msgmerge -o "$$@".tmp $$^
112    mv "$$@".tmp "$$@"
113
114  htdocs/$(1)/lang/%.po:
115    touch "$$@"
116
117  htdocs/$(1)/lang/$(1).pot:
118    xgettext --keyword=_T --keyword=N_ --from-code=UTF-8 -F -D htdocs/$(1)/ $$(subst htdocs/$(1)/,,$$^) -o "$$@".tmp
119    mv "$$@".tmp "$$@"
120
121  htdocs/$(1)/lang/$(1).pot: $(shell find htdocs/$(1) -type f | grep php | grep -v lang | grep -v config | grep -vF .swp)
122
123endef
124
125$(eval $(call htdocspo,cacher))
126$(eval $(call htdocspo,common))
127$(eval $(call htdocspo,coverager))
128$(eval $(call htdocspo,diagnosis))
129
130.PHONY: clean_po
131clean_po: clean_pot
132    rm -f htdocs/*/lang/*.po-merged
133
134.PHONY: clean_pot
135clean_pot:
136    rm -f htdocs/*/lang/*.pot
Note: See TracBrowser for help on using the repository browser.