1 # Makefile for building Lua
2 # See ../doc/readme.html for installation and customization instructions.
4 # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
6 # Your platform. See PLATS for possible values.
10 CFLAGS
= -O2
-Wall
-Wextra
-DLUA_COMPAT_5_2
$(SYSCFLAGS
) $(MYCFLAGS
)
11 LDFLAGS
= $(SYSLDFLAGS
) $(MYLDFLAGS
)
12 LIBS
= -lm
$(SYSLIBS
) $(MYLIBS
)
27 # == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
29 PLATS
= aix bsd c89 freebsd generic linux macosx mingw posix solaris
32 CORE_O
= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \
33 lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \
34 ltm.o lundump.o lvm.o lzio.o
35 LIB_O
= lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o \
36 lmathlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o loadlib.o linit.o
37 BASE_O
= $(CORE_O
) $(LIB_O
) $(MYOBJS
)
45 ALL_O
= $(BASE_O
) $(LUA_O
) $(LUAC_O
)
46 ALL_T
= $(LUA_A
) $(LUA_T
) $(LUAC_T
)
62 $(LUA_T
): $(LUA_O
) $(LUA_A
)
63 $(CC
) -o
$@
$(LDFLAGS
) $(LUA_O
) $(LUA_A
) $(LIBS
)
65 $(LUAC_T
): $(LUAC_O
) $(LUA_A
)
66 $(CC
) -o
$@
$(LDFLAGS
) $(LUAC_O
) $(LUA_A
) $(LIBS
)
69 $(RM
) $(ALL_T
) $(ALL_O
)
72 @
$(CC
) $(CFLAGS
) -MM l
*.c
77 @echo
"CFLAGS= $(CFLAGS)"
78 @echo
"LDFLAGS= $(SYSLDFLAGS)"
81 @echo
"RANLIB= $(RANLIB)"
84 # Convenience targets for popular platforms
88 @echo
"Please do 'make PLATFORM' where PLATFORM is one of these:"
92 $(MAKE
) $(ALL
) CC
="xlc" CFLAGS
="-O2 -DLUA_USE_POSIX -DLUA_USE_DLOPEN" SYSLIBS
="-ldl" SYSLDFLAGS
="-brtl -bexpall"
95 $(MAKE
) $(ALL
) SYSCFLAGS
="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" SYSLIBS
="-Wl,-E"
98 $(MAKE
) $(ALL
) SYSCFLAGS
="-DLUA_USE_C89" CC
="gcc -std=c89"
100 @echo
'*** C89 does not guarantee 64-bit integers for Lua.'
105 $(MAKE
) $(ALL
) SYSCFLAGS
="-DLUA_USE_LINUX" SYSLIBS
="-Wl,-E -lreadline"
110 $(MAKE
) $(ALL
) SYSCFLAGS
="-DLUA_USE_LINUX" SYSLIBS
="-Wl,-E -ldl -lreadline"
113 $(MAKE
) $(ALL
) SYSCFLAGS
="-DLUA_USE_MACOSX" SYSLIBS
="-lreadline" CC
=cc
116 $(MAKE
) "LUA_A=lua53.dll" "LUA_T=lua.exe" \
117 "AR=$(CC) -shared -o" "RANLIB=strip --strip-unneeded" \
118 "SYSCFLAGS=-DLUA_BUILD_AS_DLL" "SYSLIBS=" "SYSLDFLAGS=-s" lua.exe
119 $(MAKE
) "LUAC_T=luac.exe" luac.exe
122 $(MAKE
) $(ALL
) SYSCFLAGS
="-DLUA_USE_POSIX"
125 $(MAKE
) $(ALL
) SYSCFLAGS
="-DLUA_USE_POSIX -DLUA_USE_DLOPEN -D_REENTRANT" SYSLIBS
="-ldl"
127 # list targets that do not create files (but not all makes understand .PHONY)
128 .PHONY
: all $(PLATS
) default o a
clean depend echo none
132 lapi.o
: lapi.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \
133 lobject.h ltm.h lzio.h lmem.h ldebug.h ldo.h lfunc.h lgc.h lstring.h \
134 ltable.h lundump.h lvm.h
135 lauxlib.o
: lauxlib.c lprefix.h lua.h luaconf.h lauxlib.h
136 lbaselib.o
: lbaselib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
137 lbitlib.o
: lbitlib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
138 lcode.o
: lcode.c lprefix.h lua.h luaconf.h lcode.h llex.h lobject.h \
139 llimits.h lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h \
140 ldo.h lgc.h lstring.h ltable.h lvm.h
141 lcorolib.o
: lcorolib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
142 lctype.o
: lctype.c lprefix.h lctype.h lua.h luaconf.h llimits.h
143 ldblib.o
: ldblib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
144 ldebug.o
: ldebug.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \
145 lobject.h ltm.h lzio.h lmem.h lcode.h llex.h lopcodes.h lparser.h \
146 ldebug.h ldo.h lfunc.h lstring.h lgc.h ltable.h lvm.h
147 ldo.o
: ldo.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \
148 lobject.h ltm.h lzio.h lmem.h ldebug.h ldo.h lfunc.h lgc.h lopcodes.h \
149 lparser.h lstring.h ltable.h lundump.h lvm.h
150 ldump.o
: ldump.c lprefix.h lua.h luaconf.h lobject.h llimits.h lstate.h \
151 ltm.h lzio.h lmem.h lundump.h
152 lfunc.o
: lfunc.c lprefix.h lua.h luaconf.h lfunc.h lobject.h llimits.h \
153 lgc.h lstate.h ltm.h lzio.h lmem.h
154 lgc.o
: lgc.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
155 llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h lstring.h ltable.h
156 linit.o
: linit.c lprefix.h lua.h luaconf.h lualib.h lauxlib.h
157 liolib.o
: liolib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
158 llex.o
: llex.c lprefix.h lua.h luaconf.h lctype.h llimits.h ldebug.h \
159 lstate.h lobject.h ltm.h lzio.h lmem.h ldo.h lgc.h llex.h lparser.h \
161 lmathlib.o
: lmathlib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
162 lmem.o
: lmem.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
163 llimits.h ltm.h lzio.h lmem.h ldo.h lgc.h
164 loadlib.o
: loadlib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
165 lobject.o
: lobject.c lprefix.h lua.h luaconf.h lctype.h llimits.h \
166 ldebug.h lstate.h lobject.h ltm.h lzio.h lmem.h ldo.h lstring.h lgc.h \
168 lopcodes.o
: lopcodes.c lprefix.h lopcodes.h llimits.h lua.h luaconf.h
169 loslib.o
: loslib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
170 lparser.o
: lparser.c lprefix.h lua.h luaconf.h lcode.h llex.h lobject.h \
171 llimits.h lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h \
172 ldo.h lfunc.h lstring.h lgc.h ltable.h
173 lstate.o
: lstate.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \
174 lobject.h ltm.h lzio.h lmem.h ldebug.h ldo.h lfunc.h lgc.h llex.h \
176 lstring.o
: lstring.c lprefix.h lua.h luaconf.h ldebug.h lstate.h \
177 lobject.h llimits.h ltm.h lzio.h lmem.h ldo.h lstring.h lgc.h
178 lstrlib.o
: lstrlib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
179 ltable.o
: ltable.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
180 llimits.h ltm.h lzio.h lmem.h ldo.h lgc.h lstring.h ltable.h lvm.h
181 ltablib.o
: ltablib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
182 ltm.o
: ltm.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
183 llimits.h ltm.h lzio.h lmem.h ldo.h lstring.h lgc.h ltable.h lvm.h
184 lua.o
: lua.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
185 luac.o
: luac.c lprefix.h lua.h luaconf.h lauxlib.h lobject.h llimits.h \
186 lstate.h ltm.h lzio.h lmem.h lundump.h ldebug.h lopcodes.h
187 lundump.o
: lundump.c lprefix.h lua.h luaconf.h ldebug.h lstate.h \
188 lobject.h llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lstring.h lgc.h \
190 lutf8lib.o
: lutf8lib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
191 lvm.o
: lvm.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
192 llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h lopcodes.h lstring.h \
194 lzio.o
: lzio.c lprefix.h lua.h luaconf.h llimits.h lmem.h lstate.h \
195 lobject.h ltm.h lzio.h