Cleaned up makefile.
This commit is contained in:
parent
95306419d7
commit
139e214b1f
34
Makefile
34
Makefile
@ -1,22 +1,14 @@
|
||||
# makefile for immutable table library for Lua
|
||||
# usage: make LUA=/path/to/lua
|
||||
|
||||
LUAINC= $(LUA)/src
|
||||
LUALIB= $(LUA)/src
|
||||
LUABIN= $(LUA)/src
|
||||
LUASUFFIX=
|
||||
LUA_DIR=/opt/local
|
||||
LUA_INC= $(LUA_DIR)/include
|
||||
LUA_BIN= $(LUA_DIR)/bin
|
||||
LUA= lua
|
||||
|
||||
# these will probably work if Lua has been installed globally
|
||||
#LUA= /usr/local
|
||||
#LUAINC= $(LUA)/include
|
||||
#LUALIB= $(LUA)/lib
|
||||
#LUABIN= $(LUA)/bin
|
||||
|
||||
# probably no need to change anything below here
|
||||
CC= gcc
|
||||
CFLAGS= $(INCS) $(WARN) -O2 $G
|
||||
WARN= -std=c11 -pedantic -Wall -Wextra
|
||||
INCS= -I$(LUAINC)
|
||||
INCS= -I$(LUA_INC)
|
||||
#MAKESO= $(CC) -shared
|
||||
MAKESO= $(CC) -bundle -undefined dynamic_lookup
|
||||
|
||||
@ -29,7 +21,7 @@ TEST= tests.lua
|
||||
all: $T
|
||||
|
||||
test: $T
|
||||
$(LUABIN)/lua$(LUASUFFIX) $(TEST)
|
||||
$(LUA_BIN)/$(LUA) $(TEST)
|
||||
|
||||
o: $(MYLIB).o
|
||||
|
||||
@ -38,19 +30,9 @@ so: $T
|
||||
$T: $(OBJS)
|
||||
$(MAKESO) -o $@ $(OBJS)
|
||||
|
||||
$(OBJS): check-lua limmutable.c
|
||||
$(OBJS): limmutable.c
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS) $T lua_path core core.*
|
||||
|
||||
doc:
|
||||
@echo "$(MYNAME) library:"
|
||||
@fgrep '/**' $(MYLIB).c | cut -f2 -d/ | tr -d '*' | sort | column
|
||||
|
||||
check-lua:
|
||||
@if [ "$(LUA)" = "" ]; then \
|
||||
echo "usage: make LUA=/path/to/lua"; \
|
||||
exit 1; \
|
||||
fi
|
||||
rm -f $(OBJS) $T
|
||||
|
||||
# eof
|
||||
|
Loading…
Reference in New Issue
Block a user