4 IDL_PHPS
= $(wildcard *.idl.php
)
12 PHP
:= $(wildcard /usr
/local
/hphpi
/bin
/hhvm
)
13 PHP
:= $(if
$(PHP
),$(PHP
) -v Preg.ErrorLog
=false
,php
)
17 lists
: ..
/system
/ext.inc ..
/test/test_ext.h ..
/test/test_ext.inc ..
/runtime
/ext
/ext.h
19 ..
/system
/ext.inc
: idl_list.php
$(IDL_PHPS
)
21 $(V
)$(PHP
) idl_list.php inc
$@
22 $(V
)touch ..
/compiler
/builtin_symbols.
cpp
24 ..
/test/test_ext.h
: idl_list.php
$(IDL_PHPS
)
26 $(V
)$(PHP
) idl_list.php test_ext
$@
28 ..
/test/test_ext.inc
: idl_list.php
$(IDL_PHPS
)
30 $(V
)$(PHP
) idl_list.php test_suites
$@
31 $(V
)touch ..
/test/test.
cpp
33 ..
/runtime
/ext
/ext.h
: idl_list.php
$(IDL_PHPS
)
35 $(V
)$(PHP
) idl_list.php ext
$@
37 $(EXT
): $(EXT
).idl.php idl.php base.php
38 @echo
'Generating files from $<...'
39 @echo
' --> ext_$@.h ext_$@.cpp'
40 $(V
)$(PHP
) idl.php
cpp $< ext_
$@.h ext_
$@.
cpp
42 $(V
)$(PHP
) idl.php inc
$< $@.inc
43 @echo
' --> test_ext_$@.h test_ext_$@.cpp'
44 $(V
)$(PHP
) idl.php
test $< test_ext_
$@.h test_ext_
$@.
cpp
45 @echo
' --> ../runtime/ext/ext_$@.h ../runtime/ext/ext_$@.cpp'
46 $(V
)$(PHP
) idl.php param
$< ..
/runtime
/ext
/ext_
$@.h ..
/runtime
/ext
/ext_
$@.
cpp
48 # run this for a newly prepared idl file
50 $(V
)cp ext_
$<.h ext_
$<.
cpp ..
/runtime
/ext
/
51 $(REPO_ADD
) ..
/runtime
/ext
/ext_
$<.h ..
/runtime
/ext
/ext_
$<.
cpp
52 $(V
)cp
$<.inc ..
/system
/
53 $(REPO_ADD
) ..
/system
/$<.inc
54 $(V
)touch ..
/compiler
/builtin_symbols.
cpp
55 $(V
)cp test_ext_
$<.h test_ext_
$<.
cpp ..
/test/
56 $(REPO_ADD
) ..
/test/test_ext_
$<.h ..
/test/test_ext_
$<.
cpp
57 $(V
)$(PHP
) ..
/..
/bin
/license.php
59 # run this to add or remove a function from an existing idl file
61 $(V
)cp
$<.inc ..
/system
/
62 $(V
)touch ..
/compiler
/builtin_symbols.
cpp
63 $(V
)$(PHP
) ..
/..
/bin
/license.php
66 @echo
'Removing extension index...'
67 $(V
)perl
-p
-i
-n
-e
"s/#include \"$(EXT)\.inc\"\n//" \
69 @echo
'Regenerating dynamic tables...'
70 make
-C ..
/ clobber && make
-C ..
/ && make
-C ..
/system
71 @echo
'Removing list files...'
72 $(V
)perl
-p
-i
-n
-e
"s/#include <test\/test_ext_$(EXT)\.h>\n//" \
74 $(V
)perl
-p
-i
-n
-e
"s/RUN_TESTSUITE\(TestExt$(EXT)\);\n//i" \
76 $(V
)perl
-p
-i
-n
-e
"s/#include .*\/ext_$(EXT).h>\n//" \
78 @echo
'Removing source files...'
79 $(REPO_DEL
) ..
/test/test_ext_
$(EXT
).h
80 $(REPO_DEL
) ..
/test/test_ext_
$(EXT
).
cpp
81 $(REPO_DEL
) ..
/runtime
/ext
/ext_
$(EXT
).h
82 $(REPO_DEL
) ..
/runtime
/ext
/ext_
$(EXT
).
cpp
83 @echo
'Removing IDL file...'
84 $(REPO_DEL
) $(EXT
).idl.php
85 make
-C ..
/ clobber && make
-C ..
/
88 $(V
)rm -f
*~
$(patsubst %.idl.php
, %, $(IDL_PHPS
)) $(patsubst %.idl.php
, ext_
%.h
, $(IDL_PHPS
)) $(patsubst %.idl.php
, ext_
%.
cpp, $(IDL_PHPS
)) $(patsubst %.idl.php
, %.inc
, $(IDL_PHPS
)) $(patsubst %.idl.php
, test_ext_
%.h
, $(IDL_PHPS
)) $(patsubst %.idl.php
, test_ext_
%.
cpp, $(IDL_PHPS
))
90 # re-generating .inc files
93 @php idl.php inc
$(patsubst %.geninc
, %.idl.php
, $@
) \
94 $(patsubst %.geninc
, ..
/system
/%.inc
, $@
)
96 geninc-all
: $(patsubst %.idl.php
, %.geninc
, $(IDL_PHPS
))
97 @php idl.php inc ..
/..
/facebook
/extensions
/string
/string.idl.php \
98 ..
/..
/facebook
/extensions
/string
/string.inc
99 @php idl.php inc ..
/..
/facebook
/extensions
/utils
/utils.idl.php \
100 ..
/..
/facebook
/extensions
/utils
/utils.inc
101 @php idl.php inc ..
/runtime
/ext
/sep
/mhash
/mhash.idl.php \
102 ..
/runtime
/ext
/sep
/mhash
/mhash.inc
103 @php idl.php inc ..
/system
/helper.idl.php ..
/system
/helper.inc
106 @for c in
$(patsubst %.idl.php
, %, $(IDL_PHPS
)); do
$(MAKE
) update EXT
=$$c; done
;
108 # re-generating .idl files
111 @php schema.php
$(patsubst %.gendoc
, %.idl.php
, $@
) -1 > $@.php
112 @mv
-f
$@.php
$(patsubst %.gendoc
, %.idl.php
, $@
)
114 gendoc-all
: $(patsubst %.idl.php
, %.gendoc
, $(IDL_PHPS
))
116 # re-generating doc comments for system classes
118 SYS_PHPS
= $(wildcard ..
/system
/classes
/*.php
)
121 @php sysdoc.php
$(patsubst %.sysdoc
, %, $@
)
123 sysdoc-all
: $(patsubst %, %.sysdoc
, $(SYS_PHPS
))