source: trunk/devel/prepare.mak

Last change on this file was 1325, checked in by moo, 9 months ago

adds opcode string for PHP5.2 seperately for easier compiling

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