Changes in trunk/make.devel [3:1]
- File:
-
- 1 edited
-
trunk/make.devel (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/make.devel
r3 r1 1 #!/bin/bash 1 #!/usr/bin/make -if 2 # vim:syntax=make 3 SELF=MAKELEVEL=0 ./make.devel 2 4 3 if test -e make.inc ; then 4 . make.inc 5 else 6 echo make.inc is required, see make.inc.example >&2 7 exit 8 fi 5 # You should copy make.inc from make.inc.default 6 include make.inc 9 7 10 CTAGS=`which ctags 2>/dev/null || which exuberant-ctags 2>/dev/null ` 11 AWK=`which gawk 2>/dev/null || which awk 2>/dev/null ` 8 all: opcode_spec_def const_string tags 12 9 13 make_all() { 14 make_opcode_spec_def.h 15 make_const_string 16 make_tags 17 } 10 clean: clean_const_string 11 rm -f tags opcode_spec_def.h 18 12 19 make_clean() { 20 make_clean_const_string 21 echo "*" rm -f tags opcode_spec_def.h22 rm -f tags opcode_spec_def.h23 } 13 const_string: 14 @-$(SELF) const_string_opcodes_php4.x.h 15 @-$(SELF) const_string_opcodes_php5.0.h 16 @-$(SELF) const_string_opcodes_php5.1.h 17 @-$(SELF) const_string_opcodes_php6.x.h 24 18 25 make_const_string() { 26 make_const_string_opcodes_php4.x.h 27 make_const_string_opcodes_php5.0.h 28 make_const_string_opcodes_php5.1.h 29 make_const_string_opcodes_php6.x.h 30 } 19 clean_const_string: 20 rm -f const_string_opcodes_php4.x.h const_string_opcodes_php5.0.h const_string_opcodes_php5.1.h const_string_opcodes_php6.x.h 31 21 32 make_clean_const_string() { 33 echo "*" rm -f const_string_opcodes_php*.h 34 rm -f const_string_opcodes_php*.h 35 } 22 const_string_opcodes_php4.x.h: $(PHP4_x_DIR)/Zend/zend_compile.h 23 ./mkopcode.awk < $(PHP4_x_DIR)/Zend/zend_compile.h > const_string_opcodes_php4.x.h 36 24 37 make_const_string_opcodes_php4.x.h() { 38 precheck const_string_opcodes_php4.x.h "${PHP4_x_DIR}/Zend/zend_compile.h" && "$AWK" -f ./mkopcode.awk < "$I" > "$O" 39 } 25 const_string_opcodes_php5.0.h: $(PHP5_0_DIR)/Zend/zend_vm_def.h 26 ./mkopcode.awk < $(PHP5_0_DIR)/Zend/zend_vm_def.h > const_string_opcodes_php5.0.h 40 27 41 make_const_string_opcodes_php5.0.h() { 42 precheck const_string_opcodes_php5.0.h "${PHP5_0_DIR}/Zend/zend_vm_def.h" && "$AWK" -f ./mkopcode.awk < "$I" > "$O" 43 } 28 const_string_opcodes_php5.1.h: $(PHP5_1_DIR)/Zend/zend_vm_def.h 29 ./mkopcode.awk < $(PHP5_1_DIR)/Zend/zend_vm_def.h > const_string_opcodes_php5.1.h 44 30 45 make_const_string_opcodes_php5.1.h() { 46 precheck const_string_opcodes_php5.1.h "${PHP5_1_DIR}/Zend/zend_vm_def.h" && "$AWK" -f ./mkopcode.awk < "$I" > "$O" 47 } 31 const_string_opcodes_php6.x.h: $(PHP6_x_DIR)/Zend/zend_vm_def.h 32 ./mkopcode.awk < $(PHP6_x_DIR)/Zend/zend_vm_def.h > const_string_opcodes_php6.x.h 48 33 49 make_const_string_opcodes_php6.x.h() { 50 precheck const_string_opcodes_php6.x.h "${PHP6_x_DIR}/Zend/zend_vm_def.h" && "$AWK" -f ./mkopcode.awk < "$I" > "$O" 51 } 34 tags: 35 test -d $(PHP_DEVEL_DIR) && ctags -R . $(PHP_DEVEL_DIR)/main $(PHP_DEVEL_DIR)/Zend $(PHP_DEVEL_DIR)/TSRM $(PHP_DEVEL_DIR)/ext/standard || ctags -R . 52 36 53 make_opcode_spec_def.h() { 54 precheck "opcode_spec_def.h" "${EA_DIR}/opcodes.c" && "$AWK" -f ./mkopcode_spec.awk < "$I" > "$O" 55 } 37 opcode_spec_def: 38 @-$(SELF) opcode_spec_def.h 56 39 57 make_tags() { 58 if test -z "$CTAGS" ; then 59 echo ctags not found, skip building tags >&2 60 return 61 fi 40 opcode_spec_def.h: $(EA_DIR)/opcodes.c 41 ./mkopcode_spec.awk < $(EA_DIR)/opcodes.c > opcode_spec_def.h \ 62 42 63 if test -d "${PHP_DEVEL_DIR}" ; then 64 echo "* Making tags with ${PHP_DEVEL_DIR}" 65 "$CTAGS" -R . "${PHP_DEVEL_DIR}/main" "${PHP_DEVEL_DIR}/Zend" "${PHP_DEVEL_DIR}/TSRM" "${PHP_DEVEL_DIR}/ext/standard" 66 else 67 echo "* Making tags without php source files" 68 "$CTAGS" -R . 69 fi 70 } 71 72 error() { 73 echo "$@" >&2 74 } 75 76 precheck() { 77 if ! test -e "$2" ; then 78 error X skipping "$1" because "$2" not found 79 return 1 80 fi 81 if ! test "$1" -ot "$2" ; then 82 echo O "$1" is up to date. 83 return 1 84 fi 85 O="$1" 86 I="$2" 87 echo "* Making $1 from $2" 88 return 0 89 } 90 91 if test -z "$1" ; then 92 make_all 93 else 94 while ! test -z "$1" ; do 95 eval "make_$1" 96 shift 97 done 98 fi 99 43 .PHONY: const_string opcode_spec_def
Note: See TracChangeset
for help on using the changeset viewer.

