* Don't override environment variables in Makefile

This commit is contained in:
Steven Barth 2008-06-02 21:01:59 +00:00
parent 561b0cfaa3
commit d76980c194

View file

@ -1,22 +1,22 @@
OS ?= $(shell uname) OS ?= $(shell uname)
LUA_SHLIBS = $(shell pkg-config --silence-errors --libs lua5.1) LUA_SHLIBS ?= $(shell pkg-config --silence-errors --libs lua5.1)
LUA_LIBS = $(if $(LUA_SHLIBS),$(LUA_SHLIBS),$(firstword $(wildcard /usr/lib/liblua.a /usr/local/lib/liblua.a /opt/local/lib/liblua.a))) LUA_LIBS ?= $(if $(LUA_SHLIBS),$(LUA_SHLIBS),$(firstword $(wildcard /usr/lib/liblua.a /usr/local/lib/liblua.a /opt/local/lib/liblua.a)))
LUA_CFLAGS = $(shell pkg-config --silence-errors --cflags lua5.1) LUA_CFLAGS ?= $(shell pkg-config --silence-errors --cflags lua5.1)
CC = gcc CC ?= gcc
AR = ar AR ?= ar
RANLIB = ranlib RANLIB ?= ranlib
CFLAGS = -O2 CFLAGS ?= -O2
FPIC = -fPIC FPIC ?= -fPIC
EXTRA_CFLAGS = --std=gnu99 EXTRA_CFLAGS ?= --std=gnu99
WFLAGS = -Wall -Werror -pedantic WFLAGS ?= -Wall -Werror -pedantic
CPPFLAGS = CPPFLAGS ?=
COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) $(WFLAGS) COMPILE ?= $(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) $(WFLAGS)
ifeq ($(OS),Darwin) ifeq ($(OS),Darwin)
SHLIB_FLAGS = -bundle -undefined dynamic_lookup SHLIB_FLAGS ?= -bundle -undefined dynamic_lookup
else else
SHLIB_FLAGS = -shared SHLIB_FLAGS ?= -shared
endif endif
LINK = $(CC) LINK ?= $(CC)