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