Makefile 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. # makefile for installing Lua
  2. # see INSTALL for installation instructions
  3. # see src/Makefile and src/luaconf.h for further customization
  4. # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
  5. # Your platform. See PLATS for possible values.
  6. PLAT= none
  7. # Where to install. The installation starts in the src and doc directories,
  8. # so take care if INSTALL_TOP is not an absolute path.
  9. INSTALL_TOP= /usr/local
  10. INSTALL_BIN= $(INSTALL_TOP)/bin
  11. INSTALL_INC= $(INSTALL_TOP)/include
  12. INSTALL_LIB= $(INSTALL_TOP)/lib
  13. INSTALL_MAN= $(INSTALL_TOP)/man/man1
  14. #
  15. # You probably want to make INSTALL_LMOD and INSTALL_CMOD consistent with
  16. # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h (and also with etc/lua.pc).
  17. INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
  18. INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V
  19. # How to install. If your install program does not support "-p", then you
  20. # may have to run ranlib on the installed liblua.a (do "make ranlib").
  21. INSTALL= install -p
  22. INSTALL_EXEC= $(INSTALL) -m 0755
  23. INSTALL_DATA= $(INSTALL) -m 0644
  24. #
  25. # If you don't have install you can use cp instead.
  26. # INSTALL= cp -p
  27. # INSTALL_EXEC= $(INSTALL)
  28. # INSTALL_DATA= $(INSTALL)
  29. # Utilities.
  30. MKDIR= mkdir -p
  31. RANLIB= ranlib
  32. # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
  33. # Convenience platforms targets.
  34. PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
  35. # What to install.
  36. TO_BIN= lua luac
  37. TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp
  38. TO_LIB= liblua.a
  39. TO_MAN= lua.1 luac.1
  40. # Lua version and release.
  41. V= 5.1
  42. R= 5.1.5
  43. all: $(PLAT)
  44. $(PLATS) clean:
  45. cd src && $(MAKE) $@
  46. test: dummy
  47. src/lua test/hello.lua
  48. install: dummy
  49. cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
  50. cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
  51. cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
  52. cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
  53. cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
  54. ranlib:
  55. cd src && cd $(INSTALL_LIB) && $(RANLIB) $(TO_LIB)
  56. local:
  57. $(MAKE) install INSTALL_TOP=..
  58. none:
  59. @echo "Please do"
  60. @echo " make PLATFORM"
  61. @echo "where PLATFORM is one of these:"
  62. @echo " $(PLATS)"
  63. @echo "See INSTALL for complete instructions."
  64. # make may get confused with test/ and INSTALL in a case-insensitive OS
  65. dummy:
  66. # echo config parameters
  67. echo:
  68. @echo ""
  69. @echo "These are the parameters currently set in src/Makefile to build Lua $R:"
  70. @echo ""
  71. @cd src && $(MAKE) -s echo
  72. @echo ""
  73. @echo "These are the parameters currently set in Makefile to install Lua $R:"
  74. @echo ""
  75. @echo "PLAT = $(PLAT)"
  76. @echo "INSTALL_TOP = $(INSTALL_TOP)"
  77. @echo "INSTALL_BIN = $(INSTALL_BIN)"
  78. @echo "INSTALL_INC = $(INSTALL_INC)"
  79. @echo "INSTALL_LIB = $(INSTALL_LIB)"
  80. @echo "INSTALL_MAN = $(INSTALL_MAN)"
  81. @echo "INSTALL_LMOD = $(INSTALL_LMOD)"
  82. @echo "INSTALL_CMOD = $(INSTALL_CMOD)"
  83. @echo "INSTALL_EXEC = $(INSTALL_EXEC)"
  84. @echo "INSTALL_DATA = $(INSTALL_DATA)"
  85. @echo ""
  86. @echo "See also src/luaconf.h ."
  87. @echo ""
  88. # echo private config parameters
  89. pecho:
  90. @echo "V = $(V)"
  91. @echo "R = $(R)"
  92. @echo "TO_BIN = $(TO_BIN)"
  93. @echo "TO_INC = $(TO_INC)"
  94. @echo "TO_LIB = $(TO_LIB)"
  95. @echo "TO_MAN = $(TO_MAN)"
  96. # echo config parameters as Lua code
  97. # uncomment the last sed expression if you want nil instead of empty strings
  98. lecho:
  99. @echo "-- installation parameters for Lua $R"
  100. @echo "VERSION = '$V'"
  101. @echo "RELEASE = '$R'"
  102. @$(MAKE) echo | grep = | sed -e 's/= /= "/' -e 's/$$/"/' #-e 's/""/nil/'
  103. @echo "-- EOF"
  104. # list targets that do not create files (but not all makes understand .PHONY)
  105. .PHONY: all $(PLATS) clean test install local none dummy echo pecho lecho
  106. # (end of Makefile)