source: trunk/devel/prepare.mak

Last change on this file was 1486, checked in by moo, 8 weeks ago

WIP PHP_5_6 support

File size: 4.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.2.h \
24    xcache/xc_const_string_opcodes_php5.3.h \
25    xcache/xc_const_string_opcodes_php5.4.h \
26    xcache/xc_const_string_opcodes_php5.5.h \
27    xcache/xc_const_string_opcodes_php5.6.h \
28    xcache/xc_const_string_opcodes_php6.x.h
29
30ifeq (${EA_DIR},)
31xcache/xc_opcode_spec_def.h: dummy
32    @echo "Skipped $@: EA_DIR not set"
33else
34xcache/xc_opcode_spec_def.h: ${EA_DIR}/opcodes.c
35    $(AWK) -f ./devel/gen_xc_opcode_spec.awk < "$<" > "$@".tmp
36    mv "$@".tmp "$@"
37endif
38
39ifeq (${PHP4_x_DIR},)
40xcache/xc_const_string_opcodes_php4.x.h: dummy
41    @echo "Skipped $@: PHP_4_x_DIR not set"
42else
43xcache/xc_const_string_opcodes_php4.x.h: ${PHP4_x_DIR}/Zend/zend_compile.h
44    $(AWK) -f ./devel/gen_const_string_opcodes.awk < "$<" > "$@.tmp"
45    mv "$@.tmp" "$@"
46endif
47
48ifeq (${PHP5_0_DIR},)
49xcache/xc_const_string_opcodes_php5.0.h: dummy
50    @echo "Skipped $@: PHP_5_0_DIR not set"
51else
52xcache/xc_const_string_opcodes_php5.0.h: ${PHP5_0_DIR}/Zend/zend_compile.h
53    $(AWK) -f ./devel/gen_const_string_opcodes.awk < "$<" > "$@.tmp"
54    mv "$@.tmp" "$@"
55endif
56
57ifeq (${PHP5_1_DIR},)
58xcache/xc_const_string_opcodes_php5.1.h: dummy
59    @echo "Skipped $@: PHP_5_1_DIR not set"
60else
61xcache/xc_const_string_opcodes_php5.1.h: ${PHP5_1_DIR}/Zend/zend_vm_def.h
62    $(AWK) -f ./devel/gen_const_string_opcodes.awk < "$<" > "$@.tmp"
63    mv "$@.tmp" "$@"
64endif
65
66ifeq (${PHP5_2_DIR},)
67xcache/xc_const_string_opcodes_php5.2.h: dummy
68    @echo "Skipped $@: PHP_5_2_DIR not set"
69else
70xcache/xc_const_string_opcodes_php5.2.h: ${PHP5_2_DIR}/Zend/zend_vm_def.h
71    $(AWK) -f ./devel/gen_const_string_opcodes.awk < "$<" > "$@.tmp"
72    mv "$@.tmp" "$@"
73endif
74
75ifeq (${PHP5_3_DIR},)
76xcache/xc_const_string_opcodes_php5.3.h: dummy
77    @echo "Skipped $@: PHP_5_3_DIR not set"
78else
79xcache/xc_const_string_opcodes_php5.3.h: ${PHP5_3_DIR}/Zend/zend_vm_def.h
80    $(AWK) -f ./devel/gen_const_string_opcodes.awk < "$<" > "$@.tmp"
81    mv "$@.tmp" "$@"
82endif
83
84ifeq (${PHP5_4_DIR},)
85xcache/xc_const_string_opcodes_php5.4.h: dummy
86    @echo "Skipped $@: PHP_5_4_DIR not set"
87else
88xcache/xc_const_string_opcodes_php5.4.h: ${PHP5_4_DIR}/Zend/zend_vm_def.h
89    $(AWK) -f ./devel/gen_const_string_opcodes.awk < "$<" > "$@.tmp"
90    mv "$@.tmp" "$@"
91endif
92
93ifeq (${PHP5_5_DIR},)
94xcache/xc_const_string_opcodes_php5.5.h: dummy
95    @echo "Skipped $@: PHP_5_5_DIR not set"
96else
97xcache/xc_const_string_opcodes_php5.5.h: ${PHP5_5_DIR}/Zend/zend_vm_def.h
98    $(AWK) -f ./devel/gen_const_string_opcodes.awk < "$<" > "$@.tmp"
99    mv "$@.tmp" "$@"
100endif
101
102ifeq (${PHP5_6_DIR},)
103xcache/xc_const_string_opcodes_php5.6.h: dummy
104    @echo "Skipped $@: PHP_5_6_DIR not set"
105else
106xcache/xc_const_string_opcodes_php5.6.h: ${PHP5_6_DIR}/Zend/zend_vm_def.h
107    $(AWK) -f ./devel/gen_const_string_opcodes.awk < "$<" > "$@.tmp"
108    mv "$@.tmp" "$@"
109endif
110
111ifeq (${PHP6_x_DIR},)
112xcache/xc_const_string_opcodes_php6.x.h: dummy
113    @echo "Skipped $@: PHP_6_x_DIR not set"
114else
115xcache/xc_const_string_opcodes_php6.x.h: ${PHP6_x_DIR}/Zend/zend_vm_def.h
116    $(AWK) -f ./devel/gen_const_string_opcodes.awk < "$<" > "$@.tmp"
117    mv "$@.tmp" "$@"
118endif
119
120ifeq (${PHP_DEVEL_DIR},)
121tags:
122    @echo "* Making tags without php source files"
123    "$(CTAGS)" -R .
124else
125tags:
126    @echo "* Making tags with ${PHP_DEVEL_DIR}"
127    "$(CTAGS)" -R . "${PHP_DEVEL_DIR}/main" "${PHP_DEVEL_DIR}/Zend" "${PHP_DEVEL_DIR}/TSRM" "${PHP_DEVEL_DIR}/ext/standard"
128endif
129
130.PHONY: po
131define htdocspo
132  po: \
133    htdocs/$(1)/lang/en.po \
134    htdocs/$(1)/lang/en.po-merged \
135    htdocs/$(1)/lang/zh-simplified.po-merged \
136    htdocs/$(1)/lang/zh-simplified.po \
137    htdocs/$(1)/lang/zh-traditional.po \
138    htdocs/$(1)/lang/zh-traditional.po-merged
139
140  htdocs/$(1)/lang/%.po-merged: htdocs/$(1)/lang/%.po htdocs/$(1)/lang/$(1).pot
141    msgmerge -o "$$@".tmp $$^
142    mv "$$@".tmp "$$@"
143
144  htdocs/$(1)/lang/%.po:
145    touch "$$@"
146
147  htdocs/$(1)/lang/$(1).pot:
148    xgettext --keyword=_T --keyword=N_ --from-code=UTF-8 -F -D htdocs/$(1)/ $$(subst htdocs/$(1)/,,$$^) -o "$$@".tmp
149    mv "$$@".tmp "$$@"
150
151  htdocs/$(1)/lang/$(1).pot: $(shell find htdocs/$(1) -type f | grep php | grep -v lang | grep -v config | grep -vF .swp)
152
153endef
154
155$(eval $(call htdocspo,cacher))
156$(eval $(call htdocspo,common))
157$(eval $(call htdocspo,coverager))
158$(eval $(call htdocspo,diagnosis))
159
160.PHONY: clean_po
161clean_po: clean_pot
162    rm -f htdocs/*/lang/*.po-merged
163
164.PHONY: clean_pot
165clean_pot:
166    rm -f htdocs/*/lang/*.pot
Note: See TracBrowser for help on using the repository browser.