Yann Collet | 4856a00 | 2015-01-24 01:58:16 +0100 | [diff] [blame^] | 1 | # ################################################################ |
| 2 | # zstd - Makefile |
| 3 | # Copyright (C) Yann Collet 2014-2015 |
| 4 | # All rights reserved. |
| 5 | # |
| 6 | # BSD license |
| 7 | # |
| 8 | # Redistribution and use in source and binary forms, with or without modification, |
| 9 | # are permitted provided that the following conditions are met: |
| 10 | # |
| 11 | # * Redistributions of source code must retain the above copyright notice, this |
| 12 | # list of conditions and the following disclaimer. |
| 13 | # |
| 14 | # * Redistributions in binary form must reproduce the above copyright notice, this |
| 15 | # list of conditions and the following disclaimer in the documentation and/or |
| 16 | # other materials provided with the distribution. |
| 17 | # |
| 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| 19 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 20 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
| 22 | # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 23 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 24 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
| 25 | # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 26 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 27 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | # |
| 29 | # You can contact the author at : |
| 30 | # - zstd source repository : https://github.com/Cyan4973/zstd |
| 31 | # - Public forum : https://groups.google.com/forum/#!forum/lz4c |
| 32 | # ################################################################ |
| 33 | |
| 34 | # Version number |
| 35 | export VERSION=0 |
| 36 | export RELEASE=r$(VERSION) |
| 37 | |
| 38 | DESTDIR?= |
| 39 | PREFIX ?= /usr |
| 40 | |
| 41 | LIBDIR ?= $(PREFIX)/lib |
| 42 | INCLUDEDIR=$(PREFIX)/include |
| 43 | PRGDIR = programs |
| 44 | ZSTDDIR = lib |
| 45 | |
| 46 | # Select test target for Travis CI's Build Matrix |
| 47 | ifneq (,$(filter test-%,$(ZSTD_TRAVIS_CI_ENV))) |
| 48 | TRAVIS_TARGET=prg-travis |
| 49 | else |
| 50 | TRAVIS_TARGET=$(ZSTD_TRAVIS_CI_ENV) |
| 51 | endif |
| 52 | |
| 53 | |
| 54 | default: zstdprograms |
| 55 | |
| 56 | all: |
| 57 | @cd $(ZSTDDIR); $(MAKE) -e all |
| 58 | @cd $(PRGDIR); $(MAKE) -e all |
| 59 | |
| 60 | zstdprograms: |
| 61 | @cd $(PRGDIR); $(MAKE) -e |
| 62 | |
| 63 | clean: |
| 64 | @cd $(PRGDIR); $(MAKE) clean |
| 65 | @cd $(ZSTDDIR); $(MAKE) clean |
| 66 | # @cd examples; $(MAKE) clean |
| 67 | @echo Cleaning completed |
| 68 | |
| 69 | |
| 70 | #------------------------------------------------------------------------ |
| 71 | #make install is validated only for Linux, OSX, kFreeBSD and Hurd targets |
| 72 | ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU)) |
| 73 | |
| 74 | install: |
| 75 | @cd $(ZSTDDIR); $(MAKE) -e install |
| 76 | @cd $(PRGDIR); $(MAKE) -e install |
| 77 | |
| 78 | uninstall: |
| 79 | @cd $(ZSTDDIR); $(MAKE) uninstall |
| 80 | @cd $(PRGDIR); $(MAKE) uninstall |
| 81 | |
| 82 | travis-install: |
| 83 | sudo $(MAKE) install |
| 84 | |
| 85 | test: |
| 86 | @cd $(PRGDIR); $(MAKE) -e test |
| 87 | |
| 88 | test-travis: $(TRAVIS_TARGET) |
| 89 | |
| 90 | prg-travis: |
| 91 | @cd $(PRGDIR); $(MAKE) -e $(TRAVIS_TARGET) |
| 92 | |
| 93 | endif |