Improvements in Python support and installation of Python and includes
[tlspool] / Makefile
index 9f8a2c2..783b65e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,28 +1,47 @@
+# TLSPool Makefile-for-building-with-CMake
+#
+# This Makefile is just a stub: it invokes CMake, which in turn
+# generates Makefiles, and then uses those to make the project.
+#
+# Useful Make parameters at this level are:
+#      PREFIX=/usr/local
+#
+# For anything else, do this:
+#
+#      make configure                 # Basic configure
+#      ( cd build ; ccmake )          # CMake GUI for build configuration
+#      ( cd build ; make install )    # Build and install
+#
+PREFIX ?= /usr/local
 
-BUILDDIRS=src lib tool
+all: compile
 
-#TODO# Add doc/ as well -- after building man pages
+build-dir:
+       @mkdir -p build
 
-.PHONEY: all install clean distclean
+configure: _configure build-dir build/CMakeCache.txt
 
-all:
-       for dir in $(BUILDDIRS); do make -C "$$dir" ; done
-       @echo '#'
-       @echo '# NOTE: You may need to "make testdata" for some tool/* programs'
-       @echo '#'
+_configure:
+       @rm -f build/CMakeCache.txt
 
-install:
-       for dir in $(BUILDDIRS); do make -C "$$dir" install ; done
+build/CMakeCache.txt:
+       ( cd build && cmake .. -DCMAKE_INSTALL_PREFIX=$(PREFIX) )
 
-uninstall:
-       for dir in $(BUILDDIRS); do make -C "$$dir" uninstall ; done
+compile: build-dir build/CMakeCache.txt
+       ( cd build && $(MAKE) )
+
+install: build-dir
+       ( cd build && $(MAKE) install )
+
+test: build-dir
+       ( cd build && $(MAKE) test )
+
+uninstall: build-dir
+       ( cd build && $(MAKE) uninstall )
 
 clean:
-       for dir in $(BUILDDIRS); do make -C "$$dir" clean ; done
-       @echo '#'
-       @echo '# NOTE: Kept key material, use "make distclean" if you REALLY want to clean it'
-       @echo '#'
+       rm -rf build/
 
-distclean: clean
-       make -C testdata clean
+package: compile
+       ( cd build && $(MAKE) package )