small makefile tweak
[plcapi.git] / Makefile
1 # Makefile for phpxmlrpc library\r
2 \r
3 ### USER EDITABLE VARS ###\r
4 \r
5 # path to PHP executable, preferably CLI version\r
6 PHP=/usr/local/bin/php\r
7 \r
8 # path were xmlrpc lib files will be copied to\r
9 PHPINCLUDEDIR=/usr/local/lib/php\r
10 \r
11 # mkdir is a thorny beast under windows: make sure we can not use the cmd version, running eg. "make MKDIR=mkdir.exe"\r
12 MKDIR=mkdir\r
13 \r
14 # find too\r
15 FIND=find\r
16 \r
17 \r
18 #### DO NOT TOUCH FROM HERE ONWARDS ###\r
19 \r
20 # recover version number from code\r
21 # thanks to Firman Pribadi for unix command line help\r
22 #   on unix shells lasts char should be \\2/g )\r
23 export VERSION=$(shell grep -E "\$GLOBALS *\[ *'xmlrpcVersion' *\] *= *'" lib/xmlrpc.inc | sed -r s/"(.*= *' *)([0-9a-zA-Z.-]+)(.*)"/\2/g )\r
24 \r
25 LIBFILES=lib/xmlrpc.inc lib/xmlrpcs.inc lib/xmlrpc_wrappers.inc\r
26 \r
27 EXTRAFILES=extras/test.pl \\r
28  extras/test.py \\r
29  extras/rsakey.pem \\r
30  extras/workspace.testPhpServer.fttb\r
31 \r
32 DEMOFILES=demo/vardemo.php \\r
33  demo/demo1.txt \\r
34  demo/demo2.txt \\r
35  demo/demo3.txt\r
36 \r
37 DEMOSFILES=demo/server/discuss.php \\r
38  demo/server/server.php \\r
39  demo/server/proxy.php\r
40 \r
41 DEMOCFILES=demo/client/agesort.php \\r
42  demo/client/client.php \\r
43  demo/client/comment.php \\r
44  demo/client/introspect.php \\r
45  demo/client/mail.php \\r
46  demo/client/simple_call.php \\r
47  demo/client/which.php \\r
48  demo/client/wrap.php \\r
49  demo/client/zopetest.php\r
50 \r
51 TESTFILES=test/testsuite.php \\r
52  test/benchmark.php \\r
53  test/parse_args.php \\r
54  test/phpunit.php \\r
55  test/verify_compat.php \\r
56  test/PHPUnit/*.php\r
57 \r
58 INFOFILES=Changelog \\r
59  Makefile \\r
60  NEWS \\r
61  README\r
62 \r
63 DEBUGGERFILES=debugger/index.php \\r
64  debugger/action.php \\r
65  debugger/common.php \\r
66  debugger/controller.php\r
67 \r
68 \r
69 all: install\r
70 \r
71 install:\r
72         cp ${LIBFILES} ${PHPINCLUDEDIR}\r
73         @echo Lib files have been copied to ${PHPINCLUDEDIR}\r
74         cd doc && $(MAKE) install\r
75 \r
76 test:\r
77         cd test && ${PHP} -q testsuite.php\r
78 \r
79 \r
80 ### the following targets are to be used for library development ###\r
81 \r
82 # make tag target: tag existing working copy as release in cvs.\r
83 # todo: convert dots in underscore in $VERSION\r
84 tag:\r
85         cvs -q tag -p release_${VERSION}\r
86 \r
87 dist: xmlrpc-${VERSION}.zip xmlrpc-${VERSION}.tar.gz\r
88 \r
89 xmlrpc-${VERSION}.zip xmlrpc-${VERSION}.tar.gz: ${LIBFILES} ${DEBUGGERFILES} ${INFOFILES} ${TESTFILES} ${EXTRAFILES} ${DEMOFILES} ${DEMOSFILES} ${DEMOCFILES}\r
90         @echo ---${VERSION}---\r
91         rm -rf xmlrpc-${VERSION}\r
92         ${MKDIR} xmlrpc-${VERSION}\r
93         ${MKDIR} xmlrpc-${VERSION}/demo\r
94         ${MKDIR} xmlrpc-${VERSION}/demo/client\r
95         ${MKDIR} xmlrpc-${VERSION}/demo/server\r
96         ${MKDIR} xmlrpc-${VERSION}/test\r
97         ${MKDIR} xmlrpc-${VERSION}/test/PHPUnit\r
98         ${MKDIR} xmlrpc-${VERSION}/extras\r
99         ${MKDIR} xmlrpc-${VERSION}/lib\r
100         ${MKDIR} xmlrpc-${VERSION}/debugger\r
101         cp --parents ${DEMOFILES} xmlrpc-${VERSION}\r
102         cp --parents ${DEMOCFILES} xmlrpc-${VERSION}\r
103         cp --parents ${DEMOSFILES} xmlrpc-${VERSION}\r
104         cp --parents ${TESTFILES} xmlrpc-${VERSION}\r
105         cp --parents ${EXTRAFILES} xmlrpc-${VERSION}\r
106         cp --parents ${LIBFILES} xmlrpc-${VERSION}\r
107         cp --parents ${DEBUGGERFILES} xmlrpc-${VERSION}\r
108         cp ${INFOFILES} xmlrpc-${VERSION}\r
109         cd doc && $(MAKE) dist\r
110 #   on unix shells last char should be \;\r
111         ${FIND} xmlrpc-${VERSION} -type f ! -name "*.fttb" ! -name "*.pdf" ! -name "*.gif" -exec dos2unix "{}" \;\r
112         -rm xmlrpc-${VERSION}.zip xmlrpc-${VERSION}.tar.gz\r
113         tar -cvf xmlrpc-${VERSION}.tar xmlrpc-${VERSION}\r
114         gzip xmlrpc-${VERSION}.tar\r
115         zip -r xmlrpc-${VERSION}.zip xmlrpc-${VERSION}\r
116 \r
117 doc:\r
118         cd doc && $(MAKE) doc\r
119 \r
120 clean:\r
121         rm -rf xmlrpc-${VERSION} xmlrpc-${VERSION}.zip xmlrpc-${VERSION}.tar.gz\r
122         cd doc && $(MAKE) clean\r