2020-06-10 16:39:37 -03:00
|
|
|
# Developer's makefile for building Lua
|
|
|
|
# see luaconf.h for further customization
|
1997-09-16 16:33:21 -03:00
|
|
|
|
2005-04-07 10:52:19 -03:00
|
|
|
# == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
|
1995-10-09 15:51:49 -03:00
|
|
|
|
2013-06-20 15:56:51 -03:00
|
|
|
# Warnings valid for both C and C++
|
2014-11-05 11:02:26 -02:00
|
|
|
CWARNSCPP= \
|
2021-02-10 14:11:51 -03:00
|
|
|
-Wfatal-errors \
|
2014-11-05 11:02:26 -02:00
|
|
|
-Wextra \
|
2008-10-28 14:52:00 -02:00
|
|
|
-Wshadow \
|
|
|
|
-Wundef \
|
|
|
|
-Wwrite-strings \
|
2009-11-26 14:36:55 -02:00
|
|
|
-Wredundant-decls \
|
|
|
|
-Wdisabled-optimization \
|
2017-01-31 19:17:47 -02:00
|
|
|
-Wdouble-promotion \
|
2021-09-15 11:18:41 -03:00
|
|
|
-Wmissing-declarations \
|
2024-07-27 13:32:59 -03:00
|
|
|
-Wconversion \
|
2019-09-24 14:43:32 -03:00
|
|
|
# the next warnings might be useful sometimes,
|
|
|
|
# but usually they generate too much noise
|
2018-12-17 13:56:22 -02:00
|
|
|
# -Werror \
|
2018-06-18 15:25:19 -03:00
|
|
|
# -pedantic # warns if we use jump tables \
|
2013-03-15 11:00:08 -03:00
|
|
|
# -Wsign-conversion \
|
2011-05-06 13:00:23 -03:00
|
|
|
# -Wstrict-overflow=2 \
|
2009-11-26 14:36:55 -02:00
|
|
|
# -Wformat=2 \
|
2011-05-06 13:00:23 -03:00
|
|
|
# -Wcast-qual \
|
2008-10-28 14:52:00 -02:00
|
|
|
|
2021-02-10 14:11:51 -03:00
|
|
|
|
|
|
|
# Warnings for gcc, not valid for clang
|
|
|
|
CWARNGCC= \
|
|
|
|
-Wlogical-op \
|
|
|
|
-Wno-aggressive-loop-optimizations \
|
|
|
|
|
|
|
|
|
2013-06-20 15:56:51 -03:00
|
|
|
# The next warnings are neither valid nor needed for C++
|
|
|
|
CWARNSC= -Wdeclaration-after-statement \
|
2014-11-05 11:02:26 -02:00
|
|
|
-Wmissing-prototypes \
|
|
|
|
-Wnested-externs \
|
2010-01-13 14:19:54 -02:00
|
|
|
-Wstrict-prototypes \
|
|
|
|
-Wc++-compat \
|
|
|
|
-Wold-style-definition \
|
2015-07-01 14:52:09 -03:00
|
|
|
|
2010-01-13 14:19:54 -02:00
|
|
|
|
2021-02-10 14:11:51 -03:00
|
|
|
CWARNS= $(CWARNSCPP) $(CWARNSC) $(CWARNGCC)
|
2013-06-20 15:56:51 -03:00
|
|
|
|
2020-07-03 13:02:41 -03:00
|
|
|
# Some useful compiler options for internal tests:
|
2020-07-08 15:51:55 -03:00
|
|
|
# -DLUAI_ASSERT turns on all assertions inside Lua.
|
2020-07-03 13:02:41 -03:00
|
|
|
# -DHARDSTACKTESTS forces a reallocation of the stack at every point where
|
|
|
|
# the stack can be reallocated.
|
2020-07-08 15:36:48 -03:00
|
|
|
# -DHARDMEMTESTS forces a full collection at all points where the collector
|
|
|
|
# can run.
|
|
|
|
# -DEMERGENCYGCTESTS forces an emergency collection at every single allocation.
|
2020-07-03 13:02:41 -03:00
|
|
|
# -DEXTERNMEMCHECK removes internal consistency checking of blocks being
|
|
|
|
# deallocated (useful when an external tool like valgrind does the check).
|
|
|
|
# -DMAXINDEXRK=k limits range of constants in RK instruction operands.
|
|
|
|
# -DLUA_COMPAT_5_3
|
1995-10-09 15:51:49 -03:00
|
|
|
|
2015-11-13 15:19:46 -02:00
|
|
|
# -pg -malign-double
|
2014-11-05 11:02:26 -02:00
|
|
|
# -DLUA_USE_CTYPE -DLUA_USE_APICHECK
|
2022-10-26 10:15:09 -03:00
|
|
|
|
|
|
|
# The following options help detect "undefined behavior"s that seldom
|
|
|
|
# create problems; some are only available in newer gcc versions. To
|
2023-03-31 11:47:31 -03:00
|
|
|
# use some of them, we also have to define an environment variable
|
2022-10-26 10:15:09 -03:00
|
|
|
# ASAN_OPTIONS="detect_invalid_pointer_pairs=2".
|
|
|
|
# -fsanitize=undefined
|
|
|
|
# -fsanitize=pointer-subtract -fsanitize=address -fsanitize=pointer-compare
|
2019-09-24 14:43:32 -03:00
|
|
|
# TESTS= -DLUA_USER_H='"ltests.h"' -O0 -g
|
2011-05-06 13:00:23 -03:00
|
|
|
|
2018-06-18 15:25:19 -03:00
|
|
|
|
2019-09-24 14:43:32 -03:00
|
|
|
LOCAL = $(TESTS) $(CWARNS)
|
2002-08-06 16:12:54 -03:00
|
|
|
|
2001-07-24 14:25:30 -03:00
|
|
|
|
2024-11-15 11:43:32 -03:00
|
|
|
# To enable Linux goodies, -DLUA_USE_LINUX
|
|
|
|
# For C89, "-std=c89 -DLUA_USE_C89"
|
|
|
|
# Note that Linux/Posix options are not compatible with C89
|
2024-07-04 17:11:58 -03:00
|
|
|
MYCFLAGS= $(LOCAL) -std=c99 -DLUA_USE_LINUX
|
2011-05-06 13:00:23 -03:00
|
|
|
MYLDFLAGS= $(LOCAL) -Wl,-E
|
2024-07-04 17:11:58 -03:00
|
|
|
MYLIBS= -ldl
|
2007-12-27 10:59:43 -02:00
|
|
|
|
1997-07-01 16:32:41 -03:00
|
|
|
|
2018-02-27 15:24:23 -03:00
|
|
|
CC= gcc
|
2018-12-17 13:56:22 -02:00
|
|
|
CFLAGS= -Wall -O2 $(MYCFLAGS) -fno-stack-protector -fno-common -march=native
|
2018-06-18 15:25:19 -03:00
|
|
|
AR= ar rc
|
2005-04-07 10:52:19 -03:00
|
|
|
RANLIB= ranlib
|
|
|
|
RM= rm -f
|
1997-07-01 16:32:41 -03:00
|
|
|
|
2004-12-22 11:05:33 -02:00
|
|
|
|
1999-01-11 18:23:54 -02:00
|
|
|
|
2005-04-07 10:52:19 -03:00
|
|
|
# == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
|
1999-01-11 18:23:54 -02:00
|
|
|
|
1993-12-17 16:59:10 -02:00
|
|
|
|
2005-04-07 10:52:19 -03:00
|
|
|
LIBS = -lm
|
1996-11-06 18:48:03 -02:00
|
|
|
|
2005-04-07 10:52:19 -03:00
|
|
|
CORE_T= liblua.a
|
2009-02-19 14: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 10:52:19 -03:00
|
|
|
AUX_O= lauxlib.o
|
|
|
|
LIB_O= lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o lstrlib.o \
|
2018-02-27 15:27:30 -03:00
|
|
|
lutf8lib.o loadlib.o lcorolib.o linit.o
|
1995-11-10 15:56:06 -02:00
|
|
|
|
2005-04-07 10:52:19 -03:00
|
|
|
LUA_T= lua
|
|
|
|
LUA_O= lua.o
|
1995-11-10 15:56:06 -02:00
|
|
|
|
1993-12-17 16:59:10 -02:00
|
|
|
|
2020-07-03 13:02:41 -03:00
|
|
|
ALL_T= $(CORE_T) $(LUA_T)
|
|
|
|
ALL_O= $(CORE_O) $(LUA_O) $(AUX_O) $(LIB_O)
|
2005-04-07 10:52:19 -03:00
|
|
|
ALL_A= $(CORE_T)
|
1993-12-17 16:59:10 -02:00
|
|
|
|
2005-04-07 10:52:19 -03:00
|
|
|
all: $(ALL_T)
|
2018-12-19 13:15:14 -02:00
|
|
|
touch all
|
1993-12-17 16:59:10 -02:00
|
|
|
|
2005-04-07 10:52:19 -03:00
|
|
|
o: $(ALL_O)
|
1993-12-17 16:59:10 -02:00
|
|
|
|
2005-04-07 10:52:19 -03:00
|
|
|
a: $(ALL_A)
|
1993-12-17 16:59:10 -02:00
|
|
|
|
2005-04-07 10:52:19 -03:00
|
|
|
$(CORE_T): $(CORE_O) $(AUX_O) $(LIB_O)
|
|
|
|
$(AR) $@ $?
|
|
|
|
$(RANLIB) $@
|
1993-12-17 16:59:10 -02:00
|
|
|
|
2005-04-07 10:52:19 -03:00
|
|
|
$(LUA_T): $(LUA_O) $(CORE_T)
|
|
|
|
$(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(CORE_T) $(LIBS) $(MYLIBS) $(DL)
|
1994-07-19 19:04:51 -03:00
|
|
|
|
1996-03-15 15:22:09 -03:00
|
|
|
|
2005-04-07 10:52:19 -03:00
|
|
|
clean:
|
|
|
|
$(RM) $(ALL_T) $(ALL_O)
|
1996-11-06 18:48:03 -02:00
|
|
|
|
2005-04-07 10:52:19 -03:00
|
|
|
depend:
|
|
|
|
@$(CC) $(CFLAGS) -MM *.c
|
1994-01-10 17:49:56 -02:00
|
|
|
|
2005-04-07 10:52:19 -03: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)"
|
|
|
|
|
2018-12-17 13:56:22 -02:00
|
|
|
$(ALL_O): makefile ltests.h
|
2010-01-08 18:05:36 -02:00
|
|
|
|
2014-06-18 10:24:01 -03:00
|
|
|
# DO NOT EDIT
|
|
|
|
# automatically made with 'gcc -MM l*.c'
|
2010-01-08 18:05:36 -02:00
|
|
|
|
2014-11-05 11:02:26 -02: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
|
2024-07-01 15:58:07 -03:00
|
|
|
lauxlib.o: lauxlib.c lprefix.h lua.h luaconf.h lauxlib.h llimits.h
|
|
|
|
lbaselib.o: lbaselib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h \
|
|
|
|
llimits.h
|
2014-11-05 11:02:26 -02:00
|
|
|
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 \
|
2024-07-01 15:58:07 -03:00
|
|
|
ldo.h lgc.h lstring.h ltable.h lvm.h lopnames.h
|
|
|
|
lcorolib.o: lcorolib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h \
|
|
|
|
llimits.h
|
2014-11-05 11:02:26 -02:00
|
|
|
lctype.o: lctype.c lprefix.h lctype.h lua.h luaconf.h llimits.h
|
2024-07-01 15:58:07 -03:00
|
|
|
ldblib.o: ldblib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h llimits.h
|
2014-11-05 11:02:26 -02:00
|
|
|
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
|
2024-06-20 13:43:33 -03:00
|
|
|
ldump.o: ldump.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \
|
|
|
|
lobject.h ltm.h lzio.h lmem.h lgc.h ltable.h lundump.h
|
2018-12-17 13:56:22 -02:00
|
|
|
lfunc.o: lfunc.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
|
|
|
|
llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h
|
2015-11-13 15:19:46 -02:00
|
|
|
lgc.o: lgc.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
|
2024-06-20 13:43:33 -03:00
|
|
|
llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h llex.h lstring.h \
|
|
|
|
ltable.h
|
2024-07-01 15:58:07 -03:00
|
|
|
linit.o: linit.c lprefix.h lua.h luaconf.h lualib.h lauxlib.h llimits.h
|
|
|
|
liolib.o: liolib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h llimits.h
|
2015-05-22 16: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
|
2024-07-01 15:58:07 -03:00
|
|
|
lmathlib.o: lmathlib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h \
|
|
|
|
llimits.h
|
2015-11-13 15:19:46 -02:00
|
|
|
lmem.o: lmem.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
|
|
|
|
llimits.h ltm.h lzio.h lmem.h ldo.h lgc.h
|
2024-07-01 15:58:07 -03:00
|
|
|
loadlib.o: loadlib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h \
|
|
|
|
llimits.h
|
2014-11-05 11:02:26 -02:00
|
|
|
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
|
2024-07-01 15:58:07 -03:00
|
|
|
lopcodes.o: lopcodes.c lprefix.h lopcodes.h llimits.h lua.h luaconf.h \
|
|
|
|
lobject.h
|
|
|
|
loslib.o: loslib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h llimits.h
|
2014-11-05 11:02:26 -02:00
|
|
|
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-11-13 15:19:46 -02:00
|
|
|
lstring.o: lstring.c lprefix.h lua.h luaconf.h ldebug.h lstate.h \
|
|
|
|
lobject.h llimits.h ltm.h lzio.h lmem.h ldo.h lstring.h lgc.h
|
2024-07-01 15:58:07 -03:00
|
|
|
lstrlib.o: lstrlib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h \
|
|
|
|
llimits.h
|
2015-11-13 15:19:46 -02:00
|
|
|
ltable.o: ltable.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
|
|
|
|
llimits.h ltm.h lzio.h lmem.h ldo.h lgc.h lstring.h ltable.h lvm.h
|
2024-07-01 15:58:07 -03:00
|
|
|
ltablib.o: ltablib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h \
|
|
|
|
llimits.h
|
2014-11-05 11:02:26 -02:00
|
|
|
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 \
|
2018-12-17 13:56:22 -02:00
|
|
|
lparser.h lctype.h ldebug.h ldo.h lfunc.h lopnames.h lstring.h lgc.h \
|
|
|
|
ltable.h lualib.h
|
2015-11-13 15:19:46 -02:00
|
|
|
ltm.o: ltm.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
|
2018-02-27 15:27:30 -03:00
|
|
|
llimits.h ltm.h lzio.h lmem.h ldo.h lgc.h lstring.h ltable.h lvm.h
|
2024-07-01 15:58:07 -03:00
|
|
|
lua.o: lua.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h llimits.h
|
2015-11-13 15:19:46 -02:00
|
|
|
lundump.o: lundump.c lprefix.h lua.h luaconf.h ldebug.h lstate.h \
|
|
|
|
lobject.h llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lstring.h lgc.h \
|
2024-06-20 13:43:33 -03:00
|
|
|
ltable.h lundump.h
|
2024-07-01 15:58:07 -03:00
|
|
|
lutf8lib.o: lutf8lib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h \
|
|
|
|
llimits.h
|
2024-06-20 13:43:33 -03:00
|
|
|
lvm.o: lvm.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 \
|
|
|
|
lstring.h ltable.h lvm.h ljumptab.h
|
|
|
|
lzio.o: lzio.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \
|
|
|
|
lobject.h ltm.h lzio.h lmem.h
|
2009-02-19 14:33:51 -03:00
|
|
|
|
2010-01-08 18:05:36 -02:00
|
|
|
# (end of Makefile)
|