Squashed commit of the following:
[project/luci.git] / build / config.mk
1 OS ?= $(shell uname)
2
3 LUAC = luac
4 LUAC_OPTIONS = -s
5 LUCI_INSTALLDIR = /usr/lib/lua/luci
6 LUA_SHLIBS = $(shell pkg-config --silence-errors --libs lua5.1)
7 LUA_LIBS = $(if $(LUA_SHLIBS),$(LUA_SHLIBS),$(firstword $(wildcard /usr/lib/liblua.a /usr/local/lib/liblua.a /opt/local/lib/liblua.a)))
8 LUA_CFLAGS = $(shell pkg-config --silence-errors --cflags lua5.1)
9 ifeq ($(LUA_LIBS),)
10 $(error LUA installation not found)
11 endif
12
13 CC = gcc
14 AR = ar
15 RANLIB = ranlib
16 CFLAGS = -O2
17 FPIC = -fPIC
18 EXTRA_CFLAGS = --std=gnu99
19 WFLAGS = -Wall -Werror -pedantic
20 CPPFLAGS =
21 COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) $(WFLAGS)
22 ifeq ($(OS),Darwin)
23 SHLIB_FLAGS = -bundle -undefined dynamic_lookup
24 else
25 SHLIB_FLAGS = -shared
26 endif
27 LINK = $(CC)
28