lz4

Форк
0
/
Makefile.inc 
113 строк · 3.3 Кб
1
# ################################################################
2
# LZ4 - Makefile common definitions
3
# Copyright (C) Yann Collet 2020
4
# All rights reserved.
5
#
6
# BSD license
7
# Redistribution and use in source and binary forms, with or without modification,
8
# are permitted provided that the following conditions are met:
9
#
10
# * Redistributions of source code must retain the above copyright notice, this
11
#   list of conditions and the following disclaimer.
12
#
13
# * Redistributions in binary form must reproduce the above copyright notice, this
14
#   list of conditions and the following disclaimer in the documentation and/or
15
#   other materials provided with the distribution.
16
#
17
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
21
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
#
28
# You can contact the author at :
29
#  - LZ4 source repository : https://github.com/lz4/lz4
30
#  - LZ4 forum froup : https://groups.google.com/forum/#!forum/lz4c
31
# ################################################################
32

33
UNAME ?= uname
34

35
TARGET_OS ?= $(shell $(UNAME))
36
ifeq ($(TARGET_OS),)
37
  TARGET_OS ?= $(OS)
38
endif
39

40
ifneq (,$(filter Windows%,$(TARGET_OS)))
41
LIBLZ4_NAME = liblz4-$(LIBVER_MAJOR)
42
LIBLZ4_EXP  = liblz4.lib
43
WINBASED    = yes
44
else
45
LIBLZ4_EXP  = liblz4.dll.a
46
  ifneq (,$(filter MINGW%,$(TARGET_OS)))
47
LIBLZ4_NAME = liblz4
48
WINBASED    = yes
49
  else
50
    ifneq (,$(filter MSYS%,$(TARGET_OS)))
51
LIBLZ4_NAME = msys-lz4-$(LIBVER_MAJOR)
52
WINBASED    = yes
53
    else
54
      ifneq (,$(filter CYGWIN%,$(TARGET_OS)))
55
LIBLZ4_NAME = cyglz4-$(LIBVER_MAJOR)
56
WINBASED    = yes
57
      else
58
LIBLZ4_NAME = liblz4
59
WINBASED    = no
60
EXT         =
61
      endif
62
    endif
63
  endif
64
endif
65

66
ifeq ($(WINBASED),yes)
67
EXT        = .exe
68
WINDRES ?= windres
69
endif
70

71
LIBLZ4      = $(LIBLZ4_NAME).$(SHARED_EXT_VER)
72

73
#determine if dev/nul based on host environment
74
ifneq (,$(filter MINGW% MSYS% CYGWIN%,$(shell $(UNAME))))
75
VOID := /dev/null
76
else
77
  ifneq (,$(filter Windows%,$(OS)))
78
VOID := nul
79
  else
80
VOID  := /dev/null
81
  endif
82
endif
83

84
ifneq (,$(filter Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku MidnightBSD MINGW% CYGWIN% MSYS%,$(shell $(UNAME))))
85
POSIX_ENV = Yes
86
else
87
POSIX_ENV = No
88
endif
89

90
# Avoid symlinks when targeting Windows or building on a Windows host
91
ifeq ($(WINBASED),yes)
92
LN_SF = cp -p
93
else
94
  ifneq (,$(filter MINGW% MSYS% CYGWIN%,$(shell $(UNAME))))
95
LN_SF = cp -p
96
  else
97
    ifneq (,$(filter Windows%,$(OS)))
98
LN_SF = cp -p
99
    else
100
LN_SF  = ln -sf
101
    endif
102
  endif
103
endif
104

105
ifneq (,$(filter $(shell $(UNAME)),SunOS))
106
INSTALL ?= ginstall
107
else
108
INSTALL ?= install
109
endif
110

111
INSTALL_PROGRAM ?= $(INSTALL) -m 755
112
INSTALL_DATA    ?= $(INSTALL) -m 644
113
MAKE_DIR        ?= $(INSTALL) -d -m 755
114

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.