Make LDFLAGS overrideable.

This commit is contained in:
Yamagi 2020-03-09 09:53:54 +01:00
parent 09aad64202
commit 36f77aa318

View file

@ -252,17 +252,28 @@ GLAD_INCLUDE = -Isrc/client/refresh/gl3/glad/include
# ---------- # ----------
# Base LDFLAGS. # Base LDFLAGS. This is just the include path.
ifeq ($(YQ2_OSTYPE),Linux) ifeq ($(YQ2_OSTYPE),Linux)
LDFLAGS := -L/usr/lib -lm -ldl -rdynamic LDFLAGS ?= -L/usr/lib
else ifeq ($(YQ2_OSTYPE),FreeBSD) else ifeq ($(YQ2_OSTYPE),FreeBSD)
LDFLAGS := -L/usr/local/lib -lm LDFLAGS ?= -L/usr/local/lib
else ifeq ($(YQ2_OSTYPE),OpenBSD) else ifeq ($(YQ2_OSTYPE),OpenBSD)
LDFLAGS := -L/usr/local/lib -lm LDFLAGS ?= -L/usr/local/lib
else ifeq ($(YQ2_OSTYPE),Windows) else ifeq ($(YQ2_OSTYPE),Windows)
LDFLAGS := -L/usr/lib -lws2_32 -lwinmm -static-libgcc LDFLAGS ?= -L/usr/lib
endif
# Required libraries.
ifeq ($(YQ2_OSTYPE),Linux)
LDFLAGS += -lm -ldl -rdynamic
else ifeq ($(YQ2_OSTYPE),FreeBSD)
LDFLAGS += -lm
else ifeq ($(YQ2_OSTYPE),OpenBSD)
LDFLAGS += -lm
else ifeq ($(YQ2_OSTYPE),Windows)
LDFLAGS += -lws2_32 -lwinmm -static-libgcc
else ifeq ($(YQ2_OSTYPE), Darwin) else ifeq ($(YQ2_OSTYPE), Darwin)
LDFLAGS := $(OSX_ARCH) -lm LDFLAGS += $(OSX_ARCH)
endif endif
# Keep symbols hidden. # Keep symbols hidden.
@ -271,7 +282,8 @@ LDFLAGS += -fvisibility=hidden
ifneq ($(YQ2_OSTYPE), Darwin) ifneq ($(YQ2_OSTYPE), Darwin)
ifneq ($(YQ2_OSTYPE), OpenBSD) ifneq ($(YQ2_OSTYPE), OpenBSD)
# for some reason the OSX & OpenBSD linker doesn't support this... # For some reason the OSX & OpenBSD
# linker doesn't support this...
LDFLAGS += -Wl,--no-undefined LDFLAGS += -Wl,--no-undefined
endif endif
endif endif