Merge from trunk
[plcapi.git] / trunk / php / Makefile
diff --git a/trunk/php/Makefile b/trunk/php/Makefile
new file mode 100644 (file)
index 0000000..560ff68
--- /dev/null
@@ -0,0 +1,25 @@
+#
+# (Re)builds PHP API. PHP classes must be defined in a single file.
+#
+# Mark Huang <mlhuang@cs.princeton.edu>
+# Copyright (C) 2006 The Trustees of Princeton University
+#
+# $Id$
+#
+
+all: plc_api.php
+
+methods.php: methods.py ../PLC/__init__.py ../PLC/Methods/__init__.py
+       PYTHONPATH=.. python $< > $@
+        # Indent all lines by a couple of spaces
+       sed -i -e "s/^/  /" $@
+
+plc_api.php: header.php methods.php footer.php
+        # Set timestamp
+       sed -e "s/@DATE@/$$(date)/" header.php > $@
+       cat methods.php footer.php >> $@
+
+clean:
+       rm -f plc_api.php methods.php
+
+.PHONY: all clean