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