Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/lua/blob/master/makefile # lua [Ported from github.com/lua/lua] Cast in 'rl_readline_name' Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `lua / makefile` 224 lines ยท 8014 bytes Raw Blame History 1 # Developer's makefile for building Lua 2 # see luaconf.h for further customization 3 4 # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT ======================= 5 6 # Warnings valid for both C and C++ 7 CWARNSCPP= \ 8 -Wfatal-errors \ 9 -Wextra \ 10 -Wshadow \ 11 -Wundef \ 12 -Wwrite-strings \ 13 -Wredundant-decls \ 14 -Wdisabled-optimization \ 15 -Wdouble-promotion \ 16 -Wmissing-declarations \ 17 -Wconversion \ 18 # the next warnings might be useful sometimes, 19 # but usually they generate too much noise 20 # -Wstrict-overflow=2 \ 21 # -Werror \ 22 # -pedantic # warns if we use jump tables \ 23 # -Wformat=2 \ 24 # -Wcast-qual \ 25 26 27 # Warnings for gcc, not valid for clang 28 CWARNGCC= \ 29 -Wlogical-op \ 30 -Wno-aggressive-loop-optimizations \ 31 32 33 # The next warnings are neither valid nor needed for C++ 34 CWARNSC= -Wdeclaration-after-statement \ 35 -Wmissing-prototypes \ 36 -Wnested-externs \ 37 -Wstrict-prototypes \ 38 -Wc++-compat \ 39 -Wold-style-definition \ 40 41 42 CWARNS= $(CWARNSCPP) $(CWARNSC) $(CWARNGCC) 43 44 # Some useful compiler options for internal tests: 45 # -DLUAI_ASSERT turns on all assertions inside Lua. 46 # -DHARDSTACKTESTS forces a reallocation of the stack at every point where 47 # the stack can be reallocated. 48 # -DHARDMEMTESTS forces a full collection at all points where the collector 49 # can run. 50 # -DEMERGENCYGCTESTS forces an emergency collection at every single allocation. 51 # -DEXTERNMEMCHECK removes internal consistency checking of blocks being 52 # deallocated (useful when an external tool like valgrind does the check). 53 # -DMAXINDEXRK=k limits range of constants in RK instruction operands. 54 # -DLUA_COMPAT_5_3 55 56 # -pg -malign-double 57 # -DLUA_USE_CTYPE -DLUA_USE_APICHECK 58 59 # The following options help detect "undefined behavior"s that seldom 60 # create problems; some are only available in newer gcc versions. To 61 # use some of them, we also have to define an environment variable 62 # ASAN_OPTIONS="detect_invalid_pointer_pairs=2". 63 # -fsanitize=undefined (you may need to add "-lubsan" to libs) 64 # -fsanitize=pointer-subtract -fsanitize=address -fsanitize=pointer-compare 65 66 # Test mode: Add test library, turn on asserts, redefine several 67 # constants ("to give some bugs a chance"), track memory use, and add 68 # debug information. 69 # TESTS= -DLUA_USER_H='"ltests.h"' -Og -g 70 71 LOCAL = $(TESTS) $(CWARNS) 72 73 74 # To enable Linux goodies, -DLUA_USE_LINUX 75 # For C89, "-std=c89 -DLUA_USE_C89" 76 # Note that Linux/Posix options are not compatible with C89 77 # (For 32-bit, add option "-m32" to MYCFLAGS and MYLDFLAGS.) 78 MYCFLAGS= $(LOCAL) -std=c99 -DLUA_USE_LINUX 79 MYLDFLAGS= -Wl,-E 80 MYLIBS= -ldl 81 82 83 CC= gcc 84 # (Optionally we can use -march=native -mno-avx512f.) 85 CFLAGS= -Wall -O2 $(MYCFLAGS) -fno-stack-protector -fno-common 86 AR= ar rc 87 RANLIB= ranlib 88 RM= rm -f 89 90 91 92 # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE ========= 93 94 95 LIBS = -lm 96 97 CORE_T= liblua.a 98 CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \ 99 lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \ 100 ltm.o lundump.o lvm.o lzio.o ltests.o 101 AUX_O= lauxlib.o 102 LIB_O= lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o lstrlib.o \ 103 lutf8lib.o loadlib.o lcorolib.o linit.o 104 105 LUA_T= lua 106 LUA_O= lua.o 107 108 109 ALL_T= $(CORE_T) $(LUA_T) 110 ALL_O= $(CORE_O) $(LUA_O) $(AUX_O) $(LIB_O) 111 ALL_A= $(CORE_T) 112 113 all: $(ALL_T) 114 touch all 115 116 o: $(ALL_O) 117 118 a: $(ALL_A) 119 120 $(CORE_T): $(CORE_O) $(AUX_O) $(LIB_O) 121 $(AR) $@ $? 122 $(RANLIB) $@ 123 124 $(LUA_T): $(LUA_O) $(CORE_T) 125 $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(CORE_T) $(LIBS) $(MYLIBS) $(DL) 126 127 128 clean: 129 $(RM) $(ALL_T) $(ALL_O) 130 131 depend: 132 @$(CC) $(CFLAGS) -MM *.c 133 134 echo: 135 @echo "CC = $(CC)" 136 @echo "CFLAGS = $(CFLAGS)" 137 @echo "AR = $(AR)" 138 @echo "RANLIB = $(RANLIB)" 139 @echo "RM = $(RM)" 140 @echo "MYCFLAGS = $(MYCFLAGS)" 141 @echo "MYLDFLAGS = $(MYLDFLAGS)" 142 @echo "MYLIBS = $(MYLIBS)" 143 @echo "DL = $(DL)" 144 145 $(ALL_O): makefile ltests.h 146 147 # DO NOT EDIT 148 # automatically made with 'gcc -MM l*.c' 149 150 lapi.o: lapi.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \ 151 lobject.h ltm.h lzio.h lmem.h ldebug.h ldo.h lfunc.h lgc.h lstring.h \ 152 ltable.h lundump.h lvm.h 153 lauxlib.o: lauxlib.c lprefix.h lua.h luaconf.h lauxlib.h llimits.h 154 lbaselib.o: lbaselib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h \ 155 llimits.h 156 lcode.o: lcode.c lprefix.h lua.h luaconf.h lcode.h llex.h lobject.h \ 157 llimits.h lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h \ 158 ldo.h lgc.h lstring.h ltable.h lvm.h lopnames.h 159 lcorolib.o: lcorolib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h \ 160 llimits.h 161 lctype.o: lctype.c lprefix.h lctype.h lua.h luaconf.h llimits.h 162 ldblib.o: ldblib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h llimits.h 163 ldebug.o: ldebug.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \ 164 lobject.h ltm.h lzio.h lmem.h lcode.h llex.h lopcodes.h lparser.h \ 165 ldebug.h ldo.h lfunc.h lstring.h lgc.h ltable.h lvm.h 166 ldo.o: ldo.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \ 167 lobject.h ltm.h lzio.h lmem.h ldebug.h ldo.h lfunc.h lgc.h lopcodes.h \ 168 lparser.h lstring.h ltable.h lundump.h lvm.h 169 ldump.o: ldump.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \ 170 lobject.h ltm.h lzio.h lmem.h lgc.h ltable.h lundump.h 171 lfunc.o: lfunc.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \ 172 llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h 173 lgc.o: lgc.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \ 174 llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h lstring.h ltable.h 175 linit.o: linit.c lprefix.h lua.h luaconf.h lualib.h lauxlib.h llimits.h 176 liolib.o: liolib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h llimits.h 177 llex.o: llex.c lprefix.h lua.h luaconf.h lctype.h llimits.h ldebug.h \ 178 lstate.h lobject.h ltm.h lzio.h lmem.h ldo.h lgc.h llex.h lparser.h \ 179 lstring.h ltable.h 180 lmathlib.o: lmathlib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h \ 181 llimits.h 182 lmem.o: lmem.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \ 183 llimits.h ltm.h lzio.h lmem.h ldo.h lgc.h 184 loadlib.o: loadlib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h \ 185 llimits.h 186 lobject.o: lobject.c lprefix.h lua.h luaconf.h lctype.h llimits.h \ 187 ldebug.h lstate.h lobject.h ltm.h lzio.h lmem.h ldo.h lstring.h lgc.h \ 188 lvm.h 189 lopcodes.o: lopcodes.c lprefix.h lopcodes.h llimits.h lua.h luaconf.h \ 190 lobject.h 191 loslib.o: loslib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h llimits.h 192 lparser.o: lparser.c lprefix.h lua.h luaconf.h lcode.h llex.h lobject.h \ 193 llimits.h lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h \ 194 ldo.h lfunc.h lstring.h lgc.h ltable.h 195 lstate.o: lstate.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \ 196 lobject.h ltm.h lzio.h lmem.h ldebug.h ldo.h lfunc.h lgc.h llex.h \ 197 lstring.h ltable.h 198 lstring.o: lstring.c lprefix.h lua.h luaconf.h ldebug.h lstate.h \ 199 lobject.h llimits.h ltm.h lzio.h lmem.h ldo.h lstring.h lgc.h 200 lstrlib.o: lstrlib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h \ 201 llimits.h 202 ltable.o: ltable.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \ 203 llimits.h ltm.h lzio.h lmem.h ldo.h lgc.h lstring.h ltable.h lvm.h 204 ltablib.o: ltablib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h \ 205 llimits.h 206 ltests.o: ltests.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \ 207 lobject.h ltm.h lzio.h lmem.h lauxlib.h lcode.h llex.h lopcodes.h \ 208 lparser.h lctype.h ldebug.h ldo.h lfunc.h lopnames.h lstring.h lgc.h \ 209 ltable.h lualib.h 210 ltm.o: ltm.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \ 211 llimits.h ltm.h lzio.h lmem.h ldo.h lgc.h lstring.h ltable.h lvm.h 212 lua.o: lua.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h llimits.h 213 lundump.o: lundump.c lprefix.h lua.h luaconf.h ldebug.h lstate.h \ 214 lobject.h llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lstring.h lgc.h \ 215 ltable.h lundump.h 216 lutf8lib.o: lutf8lib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h \ 217 llimits.h 218 lvm.o: lvm.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \ 219 lobject.h ltm.h lzio.h lmem.h ldebug.h ldo.h lfunc.h lgc.h lopcodes.h \ 220 lstring.h ltable.h lvm.h ljumptab.h 221 lzio.o: lzio.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \ 222 lobject.h ltm.h lzio.h lmem.h 223 224 # (end of Makefile)