blob: d7188498d1979856440c95d72b87631d446210b5 [file] [log] [blame]
Yann Collet4856a002015-01-24 01:58:16 +01001# ################################################################
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
35export VERSION=0
36export RELEASE=r$(VERSION)
37
38DESTDIR?=
39PREFIX ?= /usr
40
41LIBDIR ?= $(PREFIX)/lib
42INCLUDEDIR=$(PREFIX)/include
43PRGDIR = programs
44ZSTDDIR = lib
45
46# Select test target for Travis CI's Build Matrix
47ifneq (,$(filter test-%,$(ZSTD_TRAVIS_CI_ENV)))
48TRAVIS_TARGET=prg-travis
49else
50TRAVIS_TARGET=$(ZSTD_TRAVIS_CI_ENV)
51endif
52
53
54default: zstdprograms
55
56all:
57 @cd $(ZSTDDIR); $(MAKE) -e all
58 @cd $(PRGDIR); $(MAKE) -e all
59
60zstdprograms:
61 @cd $(PRGDIR); $(MAKE) -e
62
63clean:
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
72ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU))
73
74install:
75 @cd $(ZSTDDIR); $(MAKE) -e install
76 @cd $(PRGDIR); $(MAKE) -e install
77
78uninstall:
79 @cd $(ZSTDDIR); $(MAKE) uninstall
80 @cd $(PRGDIR); $(MAKE) uninstall
81
82travis-install:
83 sudo $(MAKE) install
84
85test:
86 @cd $(PRGDIR); $(MAKE) -e test
87
88test-travis: $(TRAVIS_TARGET)
89
90prg-travis:
91 @cd $(PRGDIR); $(MAKE) -e $(TRAVIS_TARGET)
92
93endif