2005-04-07 06:52:19 -07:00
|
|
|
# makefile for building Lua
|
|
|
|
# see INSTALL for installation instructions
|
|
|
|
# see ../Makefile and luaconf.h for further customization
|
1997-09-16 12:33:21 -07:00
|
|
|
|
2005-04-07 06:52:19 -07:00
|
|
|
# == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
|
1995-10-09 11:51:49 -07:00
|
|
|
|
2010-01-13 08:19:54 -08:00
|
|
|
CWARNSC=-pedantic -Wextra \
|
2008-10-28 09:52:00 -07:00
|
|
|
-Waggregate-return \
|
|
|
|
-Wcast-align \
|
|
|
|
-Wdisabled-optimization \
|
|
|
|
-Wpointer-arith \
|
|
|
|
-Wshadow \
|
|
|
|
-Wsign-compare \
|
|
|
|
-Wundef \
|
|
|
|
-Wwrite-strings \
|
2009-11-26 08:36:55 -08:00
|
|
|
-Wredundant-decls \
|
|
|
|
-Wdisabled-optimization \
|
2010-01-13 08:19:54 -08:00
|
|
|
# the next warnings generate to much noise, so they are disabled
|
2009-11-26 08:36:55 -08:00
|
|
|
# -Wlogical-op \
|
|
|
|
# -Wformat=2 \
|
|
|
|
# -Wstrict-overflow=5 \
|
2008-10-28 09:52:00 -07:00
|
|
|
# -Wcast-qual \
|
|
|
|
|
2010-01-13 08:19:54 -08:00
|
|
|
# The next warnings are not valid for C++
|
|
|
|
CWARNS= $(CWARNSC) \
|
|
|
|
-Wdeclaration-after-statement \
|
|
|
|
-Wmissing-prototypes \
|
|
|
|
-Wnested-externs \
|
|
|
|
-Wstrict-prototypes \
|
|
|
|
-Wc++-compat \
|
|
|
|
-Wold-style-definition \
|
|
|
|
|
1995-10-09 11:51:49 -07:00
|
|
|
|
2006-07-11 08:53:29 -07:00
|
|
|
# -DEXTERNMEMCHECK -DHARDSTACKTESTS -DHARDMEMTESTS
|
2005-04-07 06:52:19 -07:00
|
|
|
# -g -DLUA_USER_H='"ltests.h"'
|
2004-12-22 05:05:33 -08:00
|
|
|
# -fomit-frame-pointer #-pg -malign-double
|
2010-01-13 08:19:54 -08:00
|
|
|
TESTS= -g -DLUA_USER_H='"ltests.h"'
|
2002-08-06 12:12:54 -07:00
|
|
|
|
2005-04-07 06:52:19 -07:00
|
|
|
LOCAL = $(TESTS) $(CWARNS)
|
2001-07-24 10:25:30 -07:00
|
|
|
|
2007-12-27 04:59:43 -08:00
|
|
|
MYCFLAGS= $(LOCAL)
|
|
|
|
MYLDFLAGS=
|
|
|
|
MYLIBS=
|
|
|
|
|
1997-07-01 12:32:41 -07:00
|
|
|
|
2005-04-07 06:52:19 -07:00
|
|
|
CC= gcc
|
2008-02-15 09:44:34 -08:00
|
|
|
CFLAGS= -Wall -O2 $(MYCFLAGS)
|
2007-12-27 04:59:43 -08:00
|
|
|
# CC= ~lhf/sunstudio12/bin/cc
|
|
|
|
# CFLAGS= -xO5 -v -Xc -native -xstrconst
|
2005-04-07 06:52:19 -07:00
|
|
|
AR= ar rcu
|
|
|
|
RANLIB= ranlib
|
|
|
|
RM= rm -f
|
1997-07-01 12:32:41 -07:00
|
|
|
|
2004-12-22 05:05:33 -08:00
|
|
|
|
2005-04-07 06:52:19 -07:00
|
|
|
# enable Linux goodies
|
2005-11-16 08:25:08 -08:00
|
|
|
MYCFLAGS= $(LOCAL) -DLUA_USE_LINUX
|
2005-04-07 06:52:19 -07:00
|
|
|
MYLDFLAGS= -Wl,-E
|
|
|
|
MYLIBS= -ldl -lreadline -lhistory -lncurses
|
1994-11-23 12:15:04 -08:00
|
|
|
|
1993-12-17 10:59:10 -08:00
|
|
|
|
1999-01-11 12:23:54 -08:00
|
|
|
|
2005-04-07 06:52:19 -07:00
|
|
|
# == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
|
1999-01-11 12:23:54 -08:00
|
|
|
|
1993-12-17 10:59:10 -08:00
|
|
|
|
2005-04-07 06:52:19 -07:00
|
|
|
LIBS = -lm
|
1996-11-06 12:48:03 -08:00
|
|
|
|
2005-04-07 06:52:19 -07:00
|
|
|
CORE_T= liblua.a
|
2009-02-19 09:33:51 -08:00
|
|
|
CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \
|
|
|
|
lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \
|
|
|
|
ltm.o lundump.o lvm.o lzio.o ltests.o
|
2005-04-07 06:52:19 -07:00
|
|
|
AUX_O= lauxlib.o
|
|
|
|
LIB_O= lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o lstrlib.o \
|
2009-07-01 09:16:40 -07:00
|
|
|
lbitlib.o loadlib.o linit.o
|
1995-11-10 09:56:06 -08:00
|
|
|
|
2005-04-07 06:52:19 -07:00
|
|
|
LUA_T= lua
|
|
|
|
LUA_O= lua.o
|
1995-11-10 09:56:06 -08:00
|
|
|
|
2010-01-08 12:05:36 -08:00
|
|
|
# LUAC_T= luac
|
|
|
|
# LUAC_O= luac.o print.o
|
1993-12-17 10:59:10 -08:00
|
|
|
|
2005-04-07 06:52:19 -07:00
|
|
|
ALL_T= $(CORE_T) $(LUA_T) $(LUAC_T)
|
|
|
|
ALL_O= $(CORE_O) $(LUA_O) $(LUAC_O) $(AUX_O) $(LIB_O)
|
|
|
|
ALL_A= $(CORE_T)
|
1993-12-17 10:59:10 -08:00
|
|
|
|
2005-04-07 06:52:19 -07:00
|
|
|
all: $(ALL_T)
|
1993-12-17 10:59:10 -08:00
|
|
|
|
2005-04-07 06:52:19 -07:00
|
|
|
o: $(ALL_O)
|
1993-12-17 10:59:10 -08:00
|
|
|
|
2005-04-07 06:52:19 -07:00
|
|
|
a: $(ALL_A)
|
1993-12-17 10:59:10 -08:00
|
|
|
|
2005-04-07 06:52:19 -07:00
|
|
|
$(CORE_T): $(CORE_O) $(AUX_O) $(LIB_O)
|
|
|
|
$(AR) $@ $?
|
|
|
|
$(RANLIB) $@
|
1993-12-17 10:59:10 -08:00
|
|
|
|
2005-04-07 06:52:19 -07:00
|
|
|
$(LUA_T): $(LUA_O) $(CORE_T)
|
|
|
|
$(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(CORE_T) $(LIBS) $(MYLIBS) $(DL)
|
1994-07-19 15:04:51 -07:00
|
|
|
|
2005-04-07 06:52:19 -07:00
|
|
|
$(LUAC_T): $(LUAC_O) $(CORE_T)
|
|
|
|
$(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(CORE_T) $(LIBS) $(MYLIBS)
|
1996-03-15 10:22:09 -08:00
|
|
|
|
2005-04-07 06:52:19 -07:00
|
|
|
clean:
|
2006-06-09 10:31:14 -07:00
|
|
|
rcsclean -u
|
2005-04-07 06:52:19 -07:00
|
|
|
$(RM) $(ALL_T) $(ALL_O)
|
1996-11-06 12:48:03 -08:00
|
|
|
|
2005-04-07 06:52:19 -07:00
|
|
|
depend:
|
|
|
|
@$(CC) $(CFLAGS) -MM *.c
|
1994-01-10 11:49:56 -08:00
|
|
|
|
2005-04-07 06:52:19 -07:00
|
|
|
echo:
|
|
|
|
@echo "CC = $(CC)"
|
|
|
|
@echo "CFLAGS = $(CFLAGS)"
|
|
|
|
@echo "AR = $(AR)"
|
|
|
|
@echo "RANLIB = $(RANLIB)"
|
|
|
|
@echo "RM = $(RM)"
|
|
|
|
@echo "MYCFLAGS = $(MYCFLAGS)"
|
|
|
|
@echo "MYLDFLAGS = $(MYLDFLAGS)"
|
|
|
|
@echo "MYLIBS = $(MYLIBS)"
|
|
|
|
@echo "DL = $(DL)"
|
|
|
|
|
2010-01-08 12:05:36 -08:00
|
|
|
$(ALL_O): makefile
|
|
|
|
|
2005-04-07 06:52:19 -07:00
|
|
|
# DO NOT DELETE
|
2010-01-08 12:05:36 -08:00
|
|
|
|
2008-10-03 09:40:56 -07:00
|
|
|
lapi.o: lapi.c lua.h luaconf.h lapi.h llimits.h lstate.h lobject.h ltm.h \
|
2010-01-08 12:05:36 -08:00
|
|
|
lzio.h lmem.h ldebug.h ldo.h lfunc.h lgc.h lstring.h ltable.h lundump.h \
|
|
|
|
lvm.h
|
|
|
|
lauxlib.o: lauxlib.c lua.h luaconf.h lauxlib.h
|
|
|
|
lbaselib.o: lbaselib.c lua.h luaconf.h lauxlib.h lualib.h
|
|
|
|
lbitlib.o: lbitlib.c lua.h luaconf.h lauxlib.h lualib.h
|
2004-04-30 13:13:38 -07:00
|
|
|
lcode.o: lcode.c lua.h luaconf.h lcode.h llex.h lobject.h llimits.h \
|
2010-01-08 12:05:36 -08:00
|
|
|
lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h ldo.h lgc.h \
|
|
|
|
lstring.h ltable.h
|
|
|
|
lctype.o: lctype.c lctype.h lua.h luaconf.h llimits.h
|
|
|
|
ldblib.o: ldblib.c lua.h luaconf.h lauxlib.h lualib.h
|
2008-10-03 09:40:56 -07:00
|
|
|
ldebug.o: ldebug.c lua.h luaconf.h lapi.h llimits.h lstate.h lobject.h \
|
2010-01-08 12:05:36 -08:00
|
|
|
ltm.h lzio.h lmem.h lcode.h llex.h lopcodes.h lparser.h ldebug.h ldo.h \
|
|
|
|
lfunc.h lstring.h lgc.h ltable.h lvm.h
|
2009-11-27 06:39:31 -08:00
|
|
|
ldo.o: ldo.c lua.h luaconf.h lapi.h llimits.h lstate.h lobject.h ltm.h \
|
2010-01-08 12:05:36 -08:00
|
|
|
lzio.h lmem.h ldebug.h ldo.h lfunc.h lgc.h lopcodes.h lparser.h \
|
|
|
|
lstring.h ltable.h lundump.h lvm.h
|
2008-10-03 09:40:56 -07:00
|
|
|
ldump.o: ldump.c lua.h luaconf.h lobject.h llimits.h lstate.h ltm.h \
|
2010-01-08 12:05:36 -08:00
|
|
|
lzio.h lmem.h lundump.h
|
2004-04-30 13:13:38 -07:00
|
|
|
lfunc.o: lfunc.c lua.h luaconf.h lfunc.h lobject.h llimits.h lgc.h lmem.h \
|
2010-01-08 12:05:36 -08:00
|
|
|
lopcodes.h lstate.h ltm.h lzio.h
|
2004-04-30 13:13:38 -07:00
|
|
|
lgc.o: lgc.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h ltm.h \
|
2010-01-08 12:05:36 -08:00
|
|
|
lzio.h lmem.h ldo.h lfunc.h lgc.h lstring.h ltable.h
|
|
|
|
linit.o: linit.c lua.h luaconf.h lualib.h lauxlib.h
|
|
|
|
liolib.o: liolib.c lua.h luaconf.h lauxlib.h lualib.h
|
2009-11-27 06:39:31 -08:00
|
|
|
llex.o: llex.c lua.h luaconf.h lctype.h llimits.h ldo.h lobject.h \
|
2010-01-08 12:05:36 -08:00
|
|
|
lstate.h ltm.h lzio.h lmem.h llex.h lparser.h lstring.h lgc.h ltable.h
|
|
|
|
lmathlib.o: lmathlib.c lua.h luaconf.h lauxlib.h lualib.h
|
2004-04-30 13:13:38 -07:00
|
|
|
lmem.o: lmem.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h \
|
2010-01-08 12:05:36 -08:00
|
|
|
ltm.h lzio.h lmem.h ldo.h lgc.h
|
|
|
|
loadlib.o: loadlib.c lua.h luaconf.h lauxlib.h lualib.h
|
2009-11-27 06:39:31 -08:00
|
|
|
lobject.o: lobject.c lua.h luaconf.h lctype.h llimits.h ldebug.h lstate.h \
|
2010-01-08 12:05:36 -08:00
|
|
|
lobject.h ltm.h lzio.h lmem.h ldo.h lstring.h lgc.h lvm.h
|
|
|
|
lopcodes.o: lopcodes.c lopcodes.h llimits.h lua.h luaconf.h
|
|
|
|
loslib.o: loslib.c lua.h luaconf.h lauxlib.h lualib.h
|
2004-04-30 13:13:38 -07:00
|
|
|
lparser.o: lparser.c lua.h luaconf.h lcode.h llex.h lobject.h llimits.h \
|
2010-01-08 12:05:36 -08:00
|
|
|
lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h ldo.h lfunc.h \
|
|
|
|
lstring.h lgc.h ltable.h
|
2008-10-03 09:40:56 -07:00
|
|
|
lstate.o: lstate.c lua.h luaconf.h lapi.h llimits.h lstate.h lobject.h \
|
2010-01-08 12:05:36 -08:00
|
|
|
ltm.h lzio.h lmem.h ldebug.h ldo.h lfunc.h lgc.h llex.h lstring.h \
|
|
|
|
ltable.h
|
2004-04-30 13:13:38 -07:00
|
|
|
lstring.o: lstring.c lua.h luaconf.h lmem.h llimits.h lobject.h lstate.h \
|
2010-01-08 12:05:36 -08:00
|
|
|
ltm.h lzio.h lstring.h lgc.h
|
|
|
|
lstrlib.o: lstrlib.c lua.h luaconf.h lauxlib.h lualib.h
|
2004-04-30 13:13:38 -07:00
|
|
|
ltable.o: ltable.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h \
|
2010-01-08 12:05:36 -08:00
|
|
|
ltm.h lzio.h lmem.h ldo.h lgc.h ltable.h
|
|
|
|
ltablib.o: ltablib.c lua.h luaconf.h lauxlib.h lualib.h
|
2008-10-03 09:40:56 -07:00
|
|
|
ltests.o: ltests.c lua.h luaconf.h lapi.h llimits.h lstate.h lobject.h \
|
2010-01-08 12:05:36 -08:00
|
|
|
ltm.h lzio.h lmem.h lauxlib.h lcode.h llex.h lopcodes.h lparser.h \
|
|
|
|
lctype.h ldebug.h ldo.h lfunc.h lstring.h lgc.h ltable.h lualib.h
|
2004-04-30 13:13:38 -07:00
|
|
|
ltm.o: ltm.c lua.h luaconf.h lobject.h llimits.h lstate.h ltm.h lzio.h \
|
2010-01-08 12:05:36 -08:00
|
|
|
lmem.h lstring.h lgc.h ltable.h
|
|
|
|
lua.o: lua.c lua.h luaconf.h lauxlib.h lualib.h
|
2004-04-30 13:13:38 -07:00
|
|
|
lundump.o: lundump.c lua.h luaconf.h ldebug.h lstate.h lobject.h \
|
2010-01-08 12:05:36 -08:00
|
|
|
llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lstring.h lgc.h lundump.h
|
2004-04-30 13:13:38 -07:00
|
|
|
lvm.o: lvm.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h ltm.h \
|
2010-01-08 12:05:36 -08:00
|
|
|
lzio.h lmem.h ldo.h lfunc.h lgc.h lopcodes.h lstring.h ltable.h lvm.h
|
2004-04-30 13:13:38 -07:00
|
|
|
lzio.o: lzio.c lua.h luaconf.h llimits.h lmem.h lstate.h lobject.h ltm.h \
|
2010-01-08 12:05:36 -08:00
|
|
|
lzio.h
|
2009-02-19 09:33:51 -08:00
|
|
|
|
2010-01-08 12:05:36 -08:00
|
|
|
# (end of Makefile)
|