Advertisement
_dinsdale

lua-5.3.5/src Makefile - w/ CLang target

Jan 10th, 2020
1,214
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Makefile for building Lua
  2. # See ../doc/readme.html for installation and customization instructions.
  3.  
  4. # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
  5.  
  6. # Your platform. See PLATS for possible values.
  7. PLAT= none
  8. MAKE= make
  9. CC?= gcc -std=gnu99
  10. CFLAGS= -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS)
  11. LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
  12. LIBS= -lm $(SYSLIBS) $(MYLIBS)
  13. SOLIBS= -lm
  14.  
  15. AR= ar
  16. RANLIB= ranlib
  17. RM= DEL
  18.  
  19. SYSCFLAGS=
  20. SYSLDFLAGS=
  21. SYSLIBS=
  22.  
  23. MYCFLAGS?=
  24. MYLDFLAGS?=
  25. MYLIBS=
  26. MYOBJS=
  27.  
  28. # == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
  29.  
  30. PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris
  31.  
  32. LUA_A=  liblua.a
  33. CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \
  34.     lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \
  35.     ltm.o lundump.o lvm.o lzio.o
  36. LIB_O=  lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o \
  37.     lmathlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o loadlib.o linit.o
  38. BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
  39.  
  40. LUA_T=  lua
  41. LUA_O=  lua.o
  42. LUA_SO= liblua.so
  43. LUA_LINK= $(LUA_SO)
  44. LUAC_T= luac
  45. LUAC_O= luac.o
  46.  
  47. ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
  48. ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO) $(LUA_LINK)
  49. ALL_A= $(LUA_A)
  50.  
  51. # Targets start here.
  52. default: $(PLAT)
  53.  
  54. all:    $(ALL_T)
  55.  
  56. o:  $(ALL_O)
  57.  
  58. a:  $(ALL_A)
  59.  
  60. $(LUA_SO):  $(CORE_O) $(LIB_O)
  61.     $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(MYLDFLAGS) -shared -Wl,-soname=$(LUA_SONAME) $? $(SOLIBS)
  62.  
  63. $(LUA_A): $(BASE_O)
  64.     $(AR) $(ARFLAGS) $@ $(BASE_O)
  65.     $(RANLIB) $@
  66.  
  67. $(LUA_T): $(LUA_O) $(LUA_A)
  68.     $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
  69.  
  70. $(LUAC_T): $(LUAC_O) $(LUA_A)
  71.     $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
  72.  
  73. clean:
  74.     $(RM) *.o
  75.     $(RM) *.dll
  76.     $(RM) *.exe
  77.     $(RM) *.lib
  78.  
  79. depend:
  80.     @$(CC) $(CFLAGS) -MM l*.c
  81.  
  82. echo:
  83.     @echo "PLAT= $(PLAT)"
  84.     @echo "CC= $(CC)"
  85.     @echo "CFLAGS= $(CFLAGS)"
  86.     @echo "LDFLAGS= $(SYSLDFLAGS)"
  87.     @echo "LIBS= $(LIBS)"
  88.     @echo "AR= $(AR)"
  89.     @echo "RANLIB= $(RANLIB)"
  90.     @echo "RM= $(RM)"
  91.  
  92. # Convenience targets for popular platforms
  93. ALL= all
  94.  
  95. none:
  96.     @echo "Please do 'make PLATFORM' where PLATFORM is one of these:"
  97.     @echo "   $(PLATS)"
  98.  
  99. aix:
  100.     $(MAKE) $(ALL) CC="xlc" CFLAGS="-O2 -DLUA_USE_POSIX -DLUA_USE_DLOPEN" SYSLIBS="-ldl" SYSLDFLAGS="-brtl -bexpall"
  101.  
  102. bsd:
  103.     $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" SYSLIBS="-Wl,-E"
  104.  
  105. c89:
  106.     $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_C89" CC="gcc -std=c89"
  107.     @echo ''
  108.     @echo '*** C89 does not guarantee 64-bit integers for Lua.'
  109.     @echo ''
  110.  
  111.  
  112. freebsd:
  113.     $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit" CC="cc"
  114.  
  115. generic: $(ALL)
  116.  
  117. linux:
  118.     $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"
  119.  
  120. macosx:
  121.     $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline"
  122.  
  123. mingw:
  124.     $(MAKE) "LUA_A=lua53.dll" "LUA_T=lua.exe" \
  125.     "AR=$(CC) -shared -o" "RANLIB=strip --strip-unneeded" \
  126.     "SYSCFLAGS=-DLUA_BUILD_AS_DLL" "SYSLIBS=" "SYSLDFLAGS=-s" lua.exe
  127.     $(MAKE) "LUAC_T=luac.exe" luac.exe
  128.  
  129. clang:
  130.     $(MAKE) "LUA_SO=lua53.dll" "LUA_A=libLua53.lib" "LUA_LINK=lua53.lib" "LUA_T=lua.exe" \
  131.     "AR=$(CC) -Wl -o libLua53.lib" "RANLIB=strip --strip-unneeded" \
  132.     "AR=$(CC) -shared -Wl,--out-implib,lua53.lib -o" "RANLIB=strip --strip-unneeded" \
  133.     "SYSCFLAGS=-DLUA_BUILD_AS_DLL" "SYSLIBS=" "SYSLDFLAGS=-s" lua.exe
  134.     $(MAKE) "LUAC_T=luac.exe" luac.exe
  135.  
  136. posix:
  137.     $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_POSIX"
  138.  
  139. solaris:
  140.     $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN -D_REENTRANT" SYSLIBS="-ldl"
  141.  
  142. # list targets that do not create files (but not all makes understand .PHONY)
  143. .PHONY: all $(PLATS) default o a clean depend echo none
  144.  
  145. # DO NOT DELETE
  146.  
  147. lapi.o: lapi.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 lstring.h \
  149.  ltable.h lundump.h lvm.h
  150. lauxlib.o: lauxlib.c lprefix.h lua.h luaconf.h lauxlib.h
  151. lbaselib.o: lbaselib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
  152. lbitlib.o: lbitlib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
  153. lcode.o: lcode.c lprefix.h lua.h luaconf.h lcode.h llex.h lobject.h \
  154.  llimits.h lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h \
  155.  ldo.h lgc.h lstring.h ltable.h lvm.h
  156. lcorolib.o: lcorolib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
  157. lctype.o: lctype.c lprefix.h lctype.h lua.h luaconf.h llimits.h
  158. ldblib.o: ldblib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
  159. ldebug.o: ldebug.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \
  160.  lobject.h ltm.h lzio.h lmem.h lcode.h llex.h lopcodes.h lparser.h \
  161.  ldebug.h ldo.h lfunc.h lstring.h lgc.h ltable.h lvm.h
  162. ldo.o: ldo.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \
  163.  lobject.h ltm.h lzio.h lmem.h ldebug.h ldo.h lfunc.h lgc.h lopcodes.h \
  164.  lparser.h lstring.h ltable.h lundump.h lvm.h
  165. ldump.o: ldump.c lprefix.h lua.h luaconf.h lobject.h llimits.h lstate.h \
  166.  ltm.h lzio.h lmem.h lundump.h
  167. lfunc.o: lfunc.c lprefix.h lua.h luaconf.h lfunc.h lobject.h llimits.h \
  168.  lgc.h lstate.h ltm.h lzio.h lmem.h
  169. lgc.o: lgc.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
  170.  llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h lstring.h ltable.h
  171. linit.o: linit.c lprefix.h lua.h luaconf.h lualib.h lauxlib.h
  172. liolib.o: liolib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
  173. llex.o: llex.c lprefix.h lua.h luaconf.h lctype.h llimits.h ldebug.h \
  174.  lstate.h lobject.h ltm.h lzio.h lmem.h ldo.h lgc.h llex.h lparser.h \
  175.  lstring.h ltable.h
  176. lmathlib.o: lmathlib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
  177. lmem.o: lmem.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
  178.  llimits.h ltm.h lzio.h lmem.h ldo.h lgc.h
  179. loadlib.o: loadlib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
  180. lobject.o: lobject.c lprefix.h lua.h luaconf.h lctype.h llimits.h \
  181.  ldebug.h lstate.h lobject.h ltm.h lzio.h lmem.h ldo.h lstring.h lgc.h \
  182.  lvm.h
  183. lopcodes.o: lopcodes.c lprefix.h lopcodes.h llimits.h lua.h luaconf.h
  184. loslib.o: loslib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
  185. lparser.o: lparser.c lprefix.h lua.h luaconf.h lcode.h llex.h lobject.h \
  186.  llimits.h lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h \
  187.  ldo.h lfunc.h lstring.h lgc.h ltable.h
  188. lstate.o: lstate.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \
  189.  lobject.h ltm.h lzio.h lmem.h ldebug.h ldo.h lfunc.h lgc.h llex.h \
  190.  lstring.h ltable.h
  191. lstring.o: lstring.c lprefix.h lua.h luaconf.h ldebug.h lstate.h \
  192.  lobject.h llimits.h ltm.h lzio.h lmem.h ldo.h lstring.h lgc.h
  193. lstrlib.o: lstrlib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
  194. ltable.o: ltable.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
  195.  llimits.h ltm.h lzio.h lmem.h ldo.h lgc.h lstring.h ltable.h lvm.h
  196. ltablib.o: ltablib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
  197. ltm.o: ltm.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
  198.  llimits.h ltm.h lzio.h lmem.h ldo.h lstring.h lgc.h ltable.h lvm.h
  199. lua.o: lua.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
  200. luac.o: luac.c lprefix.h lua.h luaconf.h lauxlib.h lobject.h llimits.h \
  201.  lstate.h ltm.h lzio.h lmem.h lundump.h ldebug.h lopcodes.h
  202. lundump.o: lundump.c lprefix.h lua.h luaconf.h ldebug.h lstate.h \
  203.  lobject.h llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lstring.h lgc.h \
  204.  lundump.h
  205. lutf8lib.o: lutf8lib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
  206. lvm.o: lvm.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
  207.  llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h lopcodes.h lstring.h \
  208.  ltable.h lvm.h
  209. lzio.o: lzio.c lprefix.h lua.h luaconf.h llimits.h lmem.h lstate.h \
  210.  lobject.h ltm.h lzio.h
  211.  
  212. # (end of Makefile)
Advertisement
RAW Paste Data Copied
Advertisement