1 # makefile for building Lua
2 # see ../INSTALL for installation instructions
3 # see ../Makefile and luaconf.h for further customization
5 # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
7 # Your platform. See PLATS for possible values.
11 CFLAGS
= -O0
-ggdb
-Wall
$(MYCFLAGS
)
21 # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
23 PLATS
= aix ansi bsd freebsd generic linux macosx mingw posix solaris
26 CORE_O
= lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \
27 lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o \
28 lundump.o lvm.o lzio.o
29 LIB_O
= lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o \
30 lstrlib.o loadlib.o linit.o lposix.o
36 LUAC_O
= luac.o
print.o
38 ALL_O
= $(CORE_O
) $(LIB_O
) $(LUA_O
) $(LUAC_O
)
39 ALL_T
= $(LUA_A
) $(LUA_T
) $(LUAC_T
)
50 $(LUA_A
): $(CORE_O
) $(LIB_O
)
54 $(LUA_T
): $(LUA_O
) $(LUA_A
)
55 $(CC
) -o
$@
$(MYLDFLAGS
) $(LUA_O
) $(LUA_A
) $(LIBS
)
57 $(LUAC_T
): $(LUAC_O
) $(LUA_A
)
58 $(CC
) -o
$@
$(MYLDFLAGS
) $(LUAC_O
) $(LUA_A
) $(LIBS
)
61 $(RM
) $(ALL_T
) $(ALL_O
)
64 @
$(CC
) $(CFLAGS
) -MM l
*.c
print.c
67 @echo
"PLAT = $(PLAT)"
69 @echo
"CFLAGS = $(CFLAGS)"
71 @echo
"RANLIB = $(RANLIB)"
73 @echo
"MYCFLAGS = $(MYCFLAGS)"
74 @echo
"MYLDFLAGS = $(MYLDFLAGS)"
75 @echo
"MYLIBS = $(MYLIBS)"
77 # convenience targets for popular platforms
80 @echo
"Please choose a platform:"
84 $(MAKE
) all CC
="xlc" CFLAGS
="-O2 -DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS
="-ldl" MYLDFLAGS
="-brtl -bexpall"
87 $(MAKE
) all MYCFLAGS
=-DLUA_ANSI
90 $(MAKE
) all MYCFLAGS
="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS
="-Wl,-E"
93 $(MAKE
) all MYCFLAGS
="-DLUA_USE_LINUX" MYLIBS
="-Wl,-E -lreadline"
99 $(MAKE
) all MYCFLAGS
=-DLUA_USE_LINUX MYLIBS
="-Wl,-E -ldl -lreadline -lhistory -lncurses"
102 $(MAKE
) all MYCFLAGS
=-DLUA_USE_LINUX MYLIBS
="-lreadline"
103 # use this on Mac OS X 10.3-
104 # $(MAKE) all MYCFLAGS=-DLUA_USE_MACOSX
107 $(MAKE
) "LUA_A=lua51.dll" "LUA_T=lua.exe" \
108 "AR=$(CC) -shared -o" "RANLIB=strip --strip-unneeded" \
109 "MYCFLAGS=-DLUA_BUILD_AS_DLL" "MYLIBS=" "MYLDFLAGS=-s" lua.exe
110 $(MAKE
) "LUAC_T=luac.exe" luac.exe
113 $(MAKE
) all MYCFLAGS
=-DLUA_USE_POSIX
116 $(MAKE
) all MYCFLAGS
="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS
="-ldl"
118 # list targets that do not create files (but not all makes understand .PHONY)
119 .PHONY
: all $(PLATS
) default o a
clean depend echo none
123 lapi.o
: lapi.c lua.h luaconf.h lapi.h lobject.h llimits.h ldebug.h \
124 lstate.h ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h lstring.h ltable.h \
126 lauxlib.o
: lauxlib.c lua.h luaconf.h lauxlib.h
127 lbaselib.o
: lbaselib.c lua.h luaconf.h lauxlib.h lualib.h
128 lcode.o
: lcode.c lua.h luaconf.h lcode.h llex.h lobject.h llimits.h \
129 lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h ldo.h lgc.h \
131 ldblib.o
: ldblib.c lua.h luaconf.h lauxlib.h lualib.h
132 ldebug.o
: ldebug.c lua.h luaconf.h lapi.h lobject.h llimits.h lcode.h \
133 llex.h lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h ldo.h \
134 lfunc.h lstring.h lgc.h ltable.h lvm.h
135 ldo.o
: ldo.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h ltm.h \
136 lzio.h lmem.h ldo.h lfunc.h lgc.h lopcodes.h lparser.h lstring.h \
137 ltable.h lundump.h lvm.h
138 ldump.o
: ldump.c lua.h luaconf.h lobject.h llimits.h lstate.h ltm.h \
139 lzio.h lmem.h lundump.h
140 lfunc.o
: lfunc.c lua.h luaconf.h lfunc.h lobject.h llimits.h lgc.h lmem.h \
141 lstate.h ltm.h lzio.h
142 lgc.o
: lgc.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h ltm.h \
143 lzio.h lmem.h ldo.h lfunc.h lgc.h lstring.h ltable.h
144 linit.o
: linit.c lua.h luaconf.h lualib.h lauxlib.h
145 liolib.o
: liolib.c lua.h luaconf.h lauxlib.h lualib.h
146 llex.o
: llex.c lua.h luaconf.h ldo.h lobject.h llimits.h lstate.h ltm.h \
147 lzio.h lmem.h llex.h lparser.h lstring.h lgc.h ltable.h ltokenf.c
148 lmathlib.o
: lmathlib.c lua.h luaconf.h lauxlib.h lualib.h
149 lmem.o
: lmem.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h \
150 ltm.h lzio.h lmem.h ldo.h
151 loadlib.o
: loadlib.c lua.h luaconf.h lauxlib.h lualib.h
152 lobject.o
: lobject.c lua.h luaconf.h ldo.h lobject.h llimits.h lstate.h \
153 ltm.h lzio.h lmem.h lstring.h lgc.h lvm.h
154 lopcodes.o
: lopcodes.c lopcodes.h llimits.h lua.h luaconf.h
155 loslib.o
: loslib.c lua.h luaconf.h lauxlib.h lualib.h
156 lparser.o
: lparser.c lua.h luaconf.h lcode.h llex.h lobject.h llimits.h \
157 lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h ldo.h \
158 lfunc.h lstring.h lgc.h ltable.h
159 lstate.o
: lstate.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h \
160 ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h llex.h lstring.h ltable.h
161 lstring.o
: lstring.c lua.h luaconf.h lmem.h llimits.h lobject.h lstate.h \
162 ltm.h lzio.h lstring.h lgc.h
163 lstrlib.o
: lstrlib.c lua.h luaconf.h lauxlib.h lualib.h
164 ltable.o
: ltable.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h \
165 ltm.h lzio.h lmem.h ldo.h lgc.h ltable.h
166 ltablib.o
: ltablib.c lua.h luaconf.h lauxlib.h lualib.h
167 ltm.o
: ltm.c lua.h luaconf.h lobject.h llimits.h lstate.h ltm.h lzio.h \
168 lmem.h lstring.h lgc.h ltable.h
169 lua.o
: lua.c lua.h luaconf.h lauxlib.h lualib.h
170 luac.o
: luac.c lua.h luaconf.h lauxlib.h ldo.h lobject.h llimits.h \
171 lstate.h ltm.h lzio.h lmem.h lfunc.h lopcodes.h lstring.h lgc.h \
173 lundump.o
: lundump.c lua.h luaconf.h ldebug.h lstate.h lobject.h \
174 llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lstring.h lgc.h lundump.h
175 lvm.o
: lvm.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h ltm.h \
176 lzio.h lmem.h ldo.h lfunc.h lgc.h lopcodes.h lstring.h ltable.h lvm.h
177 lzio.o
: lzio.c lua.h luaconf.h llimits.h lmem.h lstate.h lobject.h ltm.h \
179 print.o
: print.c ldebug.h lstate.h lua.h luaconf.h lobject.h llimits.h \
180 ltm.h lzio.h lmem.h lopcodes.h lundump.h
181 lposix.o
: lua.h lualib.h lauxlib.h