summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile99
1 files changed, 48 insertions, 51 deletions
diff --git a/Makefile b/Makefile
index 1f5165d..b31ebd0 100644
--- a/Makefile
+++ b/Makefile
@@ -52,36 +52,39 @@ EXT =
endif
-.PHONY: default all lib lz4 clean test versionsTest examples
+.PHONY: default
+default: lib lz4-release
-default:
- @$(MAKE) -C $(LZ4DIR)
- @$(MAKE) -C $(PRGDIR)
- @cp $(PRGDIR)/lz4$(EXT) .
+.PHONY: all
+all: allmost manuals
-all:
- @$(MAKE) -C $(LZ4DIR) $@
- @$(MAKE) -C $(PRGDIR) $@
- @$(MAKE) -C $(TESTDIR) $@
- @$(MAKE) -C $(EXDIR) $@
+.PHONY: allmost
+allmost: lib lz4 examples
+.PHONY: lib
lib:
@$(MAKE) -C $(LZ4DIR)
-lz4:
+.PHONY: lz4 lz4-release
+lz4 lz4-release: lib
@$(MAKE) -C $(PRGDIR) $@
@cp $(PRGDIR)/lz4$(EXT) .
-lz4-release:
- @$(MAKE) -C $(PRGDIR)
- @cp $(PRGDIR)/lz4$(EXT) .
+.PHONY: examples
+examples: lib lz4
+ $(MAKE) -C $(EXDIR) test
+
+.PHONY: manuals
+manuals:
+ @$(MAKE) -C contrib/gen_manual $@
+.PHONY: clean
clean:
+ @$(MAKE) -C $(LZ4DIR) $@ > $(VOID)
@$(MAKE) -C $(PRGDIR) $@ > $(VOID)
@$(MAKE) -C $(TESTDIR) $@ > $(VOID)
- @$(MAKE) -C $(LZ4DIR) $@ > $(VOID)
@$(MAKE) -C $(EXDIR) $@ > $(VOID)
- @$(MAKE) -C examples $@ > $(VOID)
+ @$(MAKE) -C contrib/gen_manual $@
@$(RM) lz4$(EXT)
@echo Cleaning completed
@@ -92,17 +95,35 @@ clean:
ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS))
HOST_OS = POSIX
-install:
- @$(MAKE) -C $(LZ4DIR) $@
- @$(MAKE) -C $(PRGDIR) $@
-
-uninstall:
+install uninstall:
@$(MAKE) -C $(LZ4DIR) $@
@$(MAKE) -C $(PRGDIR) $@
travis-install:
$(MAKE) -j1 install PREFIX=~/install_test_dir
+cmake:
+ @cd contrib/cmake_unofficial; cmake $(CMAKE_PARAMS) CMakeLists.txt; $(MAKE)
+
+endif
+
+
+ifneq (,$(filter MSYS%,$(shell uname)))
+HOST_OS = MSYS
+CMAKE_PARAMS = -G"MSYS Makefiles"
+endif
+
+
+#------------------------------------------------------------------------
+#make tests validated only for MSYS, Linux, OSX, kFreeBSD and Hurd targets
+#------------------------------------------------------------------------
+ifneq (,$(filter $(HOST_OS),MSYS POSIX))
+
+.PHONY: list
+list:
+ @$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs
+
+.PHONY: test
test:
$(MAKE) -C $(TESTDIR) $@
@@ -135,31 +156,10 @@ platformTest: clean
CFLAGS="-O3 -Werror -static" $(MAKE) -C $(TESTDIR) all
$(MAKE) -C $(TESTDIR) test-platform
+.PHONY: versionsTest
versionsTest: clean
$(MAKE) -C $(TESTDIR) $@
-examples:
- $(MAKE) -C $(LZ4DIR)
- $(MAKE) -C $(PRGDIR) lz4
- $(MAKE) -C examples test
-
-endif
-
-
-ifneq (,$(filter MSYS%,$(shell uname)))
-HOST_OS = MSYS
-CMAKE_PARAMS = -G"MSYS Makefiles"
-endif
-
-
-#------------------------------------------------------------------------
-#make tests validated only for MSYS, Linux, OSX, kFreeBSD and Hurd targets
-#------------------------------------------------------------------------
-ifneq (,$(filter $(HOST_OS),MSYS POSIX))
-
-cmake:
- @cd contrib/cmake_unofficial; cmake $(CMAKE_PARAMS) CMakeLists.txt; $(MAKE)
-
gpptest: clean
g++ -v
CC=g++ $(MAKE) -C $(LZ4DIR) all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror"
@@ -173,13 +173,10 @@ gpptest32: clean
CC=g++ $(MAKE) -C $(TESTDIR) native CFLAGS="-m32 -O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror"
c_standards: clean
- $(MAKE) all MOREFLAGS="-std=gnu90 -Werror"
- $(MAKE) clean
- $(MAKE) all MOREFLAGS="-std=c99 -Werror"
- $(MAKE) clean
- $(MAKE) all MOREFLAGS="-std=gnu99 -Werror"
- $(MAKE) clean
- $(MAKE) all MOREFLAGS="-std=c11 -Werror"
- $(MAKE) clean
+ # note : lz4 is not C90 compatible, because it requires long long support
+ CFLAGS="-std=gnu90 -Werror" $(MAKE) clean allmost
+ CFLAGS="-std=c99 -Werror" $(MAKE) clean allmost
+ CFLAGS="-std=gnu99 -Werror" $(MAKE) clean allmost
+ CFLAGS="-std=c11 -Werror" $(MAKE) clean allmost
endif