summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile16
-rw-r--r--build/cmake/.gitignore3
2 files changed, 12 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 7a5c1ef..fd62945 100644
--- a/Makefile
+++ b/Makefile
@@ -84,11 +84,12 @@ clean:
$(MAKE) -C $(FUZZDIR) $@ > $(VOID)
$(MAKE) -C contrib/gen_manual $@ > $(VOID)
$(RM) lz4$(EXT)
+ $(RM) -r $(CMAKE_BUILD_DIR)
@echo Cleaning completed
#-----------------------------------------------------------------------------
-# make install is validated only for Linux, OSX, BSD, Hurd and Solaris targets
+# make install is validated only for Posix environments
#-----------------------------------------------------------------------------
ifeq ($(POSIX_ENV),Yes)
HOST_OS = POSIX
@@ -102,21 +103,24 @@ install uninstall:
travis-install:
$(MAKE) -j1 install DESTDIR=~/install_test_dir
-.PHONY: cmake
-cmake:
- cd build/cmake; cmake $(CMAKE_PARAMS) CMakeLists.txt; $(MAKE)
-
endif # POSIX_ENV
+CMAKE ?= cmake
+CMAKE_BUILD_DIR ?= build/cmake/build
ifneq (,$(filter MSYS%,$(shell $(UNAME))))
HOST_OS = MSYS
CMAKE_PARAMS = -G"MSYS Makefiles"
endif
+.PHONY: cmake
+cmake:
+ mkdir -p $(CMAKE_BUILD_DIR)
+ cd $(CMAKE_BUILD_DIR); $(CMAKE) $(CMAKE_PARAMS) ..; $(CMAKE) --build .
+
#------------------------------------------------------------------------
-#make tests validated only for MSYS, Linux, OSX, kFreeBSD and Hurd targets
+# make tests validated only for MSYS and Posix environments
#------------------------------------------------------------------------
ifneq (,$(filter $(HOST_OS),MSYS POSIX))
diff --git a/build/cmake/.gitignore b/build/cmake/.gitignore
index d39505d..0ad8240 100644
--- a/build/cmake/.gitignore
+++ b/build/cmake/.gitignore
@@ -1,4 +1,4 @@
-# cmake artefact
+# cmake build artefact
CMakeCache.txt
CMakeFiles
@@ -7,3 +7,4 @@ Makefile
liblz4.pc
lz4c
install_manifest.txt
+build