Revert "* Don't override environment variables in Makefile"
[project/luci.git] / build / gccconfig.mk
1 OS ?= $(shell uname)
2
3 LUA_SHLIBS = $(shell pkg-config --silence-errors --libs lua5.1)
4 LUA_LIBS = $(if $(LUA_SHLIBS),$(LUA_SHLIBS),$(firstword $(wildcard /usr/lib/liblua.a /usr/local/lib/liblua.a /opt/local/lib/liblua.a)))
5 LUA_CFLAGS = $(shell pkg-config --silence-errors --cflags lua5.1)
6
7 CC = gcc
8 AR = ar
9 RANLIB = ranlib
10 CFLAGS = -O2
11 FPIC = -fPIC
12 EXTRA_CFLAGS = --std=gnu99
13 WFLAGS = -Wall -Werror -pedantic
14 CPPFLAGS =
15 COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) $(WFLAGS)
16 ifeq ($(OS),Darwin)
17 SHLIB_FLAGS = -bundle -undefined dynamic_lookup
18 else
19 SHLIB_FLAGS = -shared
20 endif
21 LINK = $(CC)
22