• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1ifeq ($(V), 1)
2Q =
3else
4Q = @
5endif
6
7TARGET_OS ?= $(shell uname)
8ifeq ($(TARGET_OS),)
9  TARGET_OS ?= $(OS)
10endif
11
12ifneq (,$(filter Windows%,$(TARGET_OS)))
13LIBLZ4 = liblz4-$(LIBVER_MAJOR)
14LIBLZ4_EXP = liblz4.lib
15WINBASED   = yes
16else
17LIBLZ4_EXP = liblz4.dll.a
18  ifneq (,$(filter MINGW%,$(TARGET_OS)))
19LIBLZ4     = liblz4
20WINBASED   = yes
21  else
22    ifneq (,$(filter MSYS%,$(TARGET_OS)))
23LIBLZ4     = msys-lz4-$(LIBVER_MAJOR)
24WINBASED   = yes
25    else
26      ifneq (,$(filter CYGWIN%,$(TARGET_OS)))
27LIBLZ4     = cyglz4-$(LIBVER_MAJOR)
28WINBASED   = yes
29      else
30LIBLZ4     = liblz4.$(SHARED_EXT_VER)
31WINBASED   = no
32EXT        =
33      endif
34    endif
35  endif
36endif
37
38ifeq ($(WINBASED),yes)
39EXT        = .exe
40WINDRES    = windres
41endif
42
43#determine if dev/nul based on host environment
44ifneq (,$(filter MINGW% MSYS% CYGWIN%,$(shell uname)))
45VOID := /dev/null
46else
47  ifneq (,$(filter Windows%,$(OS)))
48VOID := nul
49  else
50VOID  := /dev/null
51  endif
52endif
53
54ifneq (,$(filter Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku MidnightBSD MINGW% CYGWIN% MSYS%,$(shell uname)))
55POSIX_ENV = Yes
56else
57POSIX_ENV = No
58endif
59
60# Avoid symlinks when targetting Windows or building on a Windows host
61ifeq ($(WINBASED),yes)
62LN_S  = cp -p
63LN_SF = cp -p
64else
65  ifneq (,$(filter MINGW% MSYS% CYGWIN%,$(shell uname)))
66LN_S  = cp -p
67LN_SF = cp -p
68  else
69    ifneq (,$(filter Windows%,$(OS)))
70LN_S  = cp -p
71LN_SF = cp -p
72    else
73LN_S   = ln -s
74LN_SF  = ln -sf
75    endif
76  endif
77endif
78
79ifneq (,$(filter $(shell uname),SunOS))
80INSTALL ?= ginstall
81else
82INSTALL ?= install
83endif
84
85INSTALL_PROGRAM ?= $(INSTALL) -m 755
86INSTALL_DATA    ?= $(INSTALL) -m 644
87INSTALL_DIR     ?= $(INSTALL) -d -m 755
88