mirror of
https://github.com/cuberite/libdeflate.git
synced 2025-09-07 11:15:35 -04:00
Makefile: avoid redundant invocations of "$(CC) -dumpmachine"
This commit is contained in:
parent
fcafa11201
commit
7c60c4cdaf
14
Makefile
14
Makefile
@ -89,8 +89,10 @@ PROG_SUFFIX :=
|
|||||||
PROG_CFLAGS :=
|
PROG_CFLAGS :=
|
||||||
HARD_LINKS := 1
|
HARD_LINKS := 1
|
||||||
|
|
||||||
|
TARGET_MACHINE := $(shell $(CC) -dumpmachine 2>/dev/null)
|
||||||
|
|
||||||
# Compiling for Windows with MinGW?
|
# Compiling for Windows with MinGW?
|
||||||
ifneq ($(findstring -mingw,$(shell $(CC) -dumpmachine 2>/dev/null)),)
|
ifneq ($(findstring -mingw,$(TARGET_MACHINE)),)
|
||||||
STATIC_LIB_SUFFIX := static.lib
|
STATIC_LIB_SUFFIX := static.lib
|
||||||
SHARED_LIB := libdeflate.dll
|
SHARED_LIB := libdeflate.dll
|
||||||
SHARED_LIB_SYMLINK :=
|
SHARED_LIB_SYMLINK :=
|
||||||
@ -112,21 +114,21 @@ ifneq ($(findstring -mingw,$(shell $(CC) -dumpmachine 2>/dev/null)),)
|
|||||||
sed -E 's/g?cc(-?[0-9]+(\.[0-9]+)*)?(\.exe)?$$/ar\3/')
|
sed -E 's/g?cc(-?[0-9]+(\.[0-9]+)*)?(\.exe)?$$/ar\3/')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# macOS?
|
# Compiling for macOS?
|
||||||
else ifneq ($(findstring -darwin,$(shell $(CC) -dumpmachine 2>/dev/null)),)
|
else ifneq ($(findstring -darwin,$(TARGET_MACHINE)),)
|
||||||
SHARED_LIB := libdeflate.$(SOVERSION).dylib
|
SHARED_LIB := libdeflate.$(SOVERSION).dylib
|
||||||
SHARED_LIB_SYMLINK := libdeflate.dylib
|
SHARED_LIB_SYMLINK := libdeflate.dylib
|
||||||
SHARED_LIB_CFLAGS := -fPIC
|
SHARED_LIB_CFLAGS := -fPIC
|
||||||
SHARED_LIB_LDFLAGS := -install_name $(SHARED_LIB)
|
SHARED_LIB_LDFLAGS := -install_name $(SHARED_LIB)
|
||||||
|
|
||||||
# Android?
|
# Compiling for Android?
|
||||||
else ifneq ($(findstring -android,$(shell $(CC) -dumpmachine 2>/dev/null)),)
|
else ifneq ($(findstring -android,$(TARGET_MACHINE)),)
|
||||||
SHARED_LIB := libdeflate.so
|
SHARED_LIB := libdeflate.so
|
||||||
SHARED_LIB_SYMLINK :=
|
SHARED_LIB_SYMLINK :=
|
||||||
SHARED_LIB_CFLAGS := -fPIC
|
SHARED_LIB_CFLAGS := -fPIC
|
||||||
SHARED_LIB_LDFLAGS := -Wl,-soname=$(SHARED_LIB)
|
SHARED_LIB_LDFLAGS := -Wl,-soname=$(SHARED_LIB)
|
||||||
|
|
||||||
# Linux, FreeBSD, etc.
|
# Compiling for Linux, FreeBSD, etc.
|
||||||
else
|
else
|
||||||
SHARED_LIB := libdeflate.so.$(SOVERSION)
|
SHARED_LIB := libdeflate.so.$(SOVERSION)
|
||||||
SHARED_LIB_SYMLINK := libdeflate.so
|
SHARED_LIB_SYMLINK := libdeflate.so
|
||||||
|
Loading…
x
Reference in New Issue
Block a user