2018-02-09 02:13:07 -08:00
|
|
|
# makefile for immutable table library for Lua
|
|
|
|
|
2018-07-22 00:20:04 -07:00
|
|
|
LUA_DIR=/usr/local
|
2018-02-11 14:11:11 -08:00
|
|
|
LUA_INC= $(LUA_DIR)/include
|
|
|
|
LUA_BIN= $(LUA_DIR)/bin
|
|
|
|
LUA= lua
|
2018-02-09 02:13:07 -08:00
|
|
|
|
|
|
|
CC= gcc
|
|
|
|
CFLAGS= $(INCS) $(WARN) -O2 $G
|
2018-02-09 05:22:27 -08:00
|
|
|
WARN= -std=c11 -pedantic -Wall -Wextra
|
2018-02-11 14:11:11 -08:00
|
|
|
INCS= -I$(LUA_INC)
|
2020-04-21 00:22:02 -07:00
|
|
|
ifeq ($(shell uname -s),Darwin)
|
|
|
|
MAKESO= $(CC) -bundle -undefined dynamic_lookup
|
|
|
|
else
|
|
|
|
MAKESO= $(CC) -shared
|
|
|
|
endif
|
2018-02-09 02:13:07 -08:00
|
|
|
|
|
|
|
MYNAME= immutable
|
|
|
|
MYLIB= l$(MYNAME)
|
|
|
|
T= $(MYNAME).so
|
|
|
|
OBJS= $(MYLIB).o
|
2018-02-11 13:43:42 -08:00
|
|
|
TEST= tests.lua
|
2018-02-09 02:13:07 -08:00
|
|
|
|
2018-02-09 18:29:21 -08:00
|
|
|
all: $T
|
2018-02-09 02:13:07 -08:00
|
|
|
|
2018-02-09 18:29:21 -08:00
|
|
|
test: $T
|
2018-02-11 14:11:11 -08:00
|
|
|
$(LUA_BIN)/$(LUA) $(TEST)
|
2018-02-09 02:13:07 -08:00
|
|
|
|
|
|
|
o: $(MYLIB).o
|
|
|
|
|
|
|
|
so: $T
|
|
|
|
|
|
|
|
$T: $(OBJS)
|
|
|
|
$(MAKESO) -o $@ $(OBJS)
|
|
|
|
|
2018-02-12 16:37:50 -08:00
|
|
|
$(OBJS): $(MYLIB).c
|
2018-02-09 02:13:07 -08:00
|
|
|
|
|
|
|
clean:
|
2018-02-11 14:11:11 -08:00
|
|
|
rm -f $(OBJS) $T
|
2018-02-09 03:45:17 -08:00
|
|
|
|
2018-02-09 02:13:07 -08:00
|
|
|
# eof
|