remote pool_handle_t
[tlspool] / Makefile
index a36792e..783b65e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,26 +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 doc test
+all: compile
 
-.PHONEY: all install clean distclean
+build-dir:
+       @mkdir -p build
 
-all:
-       @$(foreach dir,$(BUILDDIRS),make -C '$(dir)' all && ) echo Built all
-       @echo '#'
-       @echo '# NOTE: You may need to "make testdata" for some tool/* programs'
-       @echo '#'
+configure: _configure build-dir build/CMakeCache.txt
 
-install: all
-       @$(foreach dir,$(BUILDDIRS),make -C '$(dir)' install && ) echo Installed
+_configure:
+       @rm -f build/CMakeCache.txt
 
-uninstall:
-       @$(foreach dir,$(BUILDDIRS),make -C '$(dir)' uninstall && ) echo Uninstalled
+build/CMakeCache.txt:
+       ( cd build && cmake .. -DCMAKE_INSTALL_PREFIX=$(PREFIX) )
+
+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:
-       @$(foreach dir,$(BUILDDIRS),make -C '$(dir)' clean && ) echo Cleaned
-       @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-pkcs11 clean-cert clean-pgp clean-db
+package: compile
+       ( cd build && $(MAKE) package )