Makefile 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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 directory, so take care
  8. # if INSTALL_TOP is not an absolute path. (Man pages are installed from the
  9. # doc directory.)
  10. #
  11. INSTALL_TOP= /usr/local
  12. INSTALL_BIN= $(INSTALL_TOP)/bin
  13. INSTALL_INC= $(INSTALL_TOP)/include
  14. INSTALL_LIB= $(INSTALL_TOP)/lib
  15. INSTALL_MAN= $(INSTALL_TOP)/man/man1
  16. INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
  17. INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V
  18. # How to install. You may prefer "install" instead of "cp" if you have it.
  19. # To remove debug information from binaries, use "install -s" in INSTALL_EXEC.
  20. #
  21. INSTALL_EXEC= $(CP)
  22. INSTALL_DATA= $(CP)
  23. #INSTALL_EXEC= $(INSTALL) -m 0755
  24. #INSTALL_DATA= $(INSTALL) -m 0644
  25. # Utilities.
  26. CP= cp
  27. FIND= find
  28. INSTALL= install
  29. MKDIR= mkdir
  30. RANLIB= ranlib
  31. # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
  32. # Convenience platforms targets.
  33. PLATS= aix ansi bsd generic linux macosx mingw posix solaris
  34. # What to install.
  35. TO_BIN= lua luac
  36. TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp
  37. TO_LIB= liblua.a
  38. TO_MAN= lua.1 luac.1
  39. # Lua version. Currently used only for messages.
  40. V= 5.1
  41. all: $(PLAT)
  42. $(PLATS) clean:
  43. cd src && $(MAKE) $@
  44. test: dummy
  45. src/lua test/hello.lua
  46. install: dummy
  47. cd src && $(MKDIR) -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
  48. cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
  49. cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
  50. cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
  51. cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
  52. # $(RANLIB) $(INSTALL_LIB)/$(TO_LIB)
  53. local:
  54. $(MAKE) install INSTALL_TOP=.. INSTALL_EXEC="cp -p" INSTALL_DATA="cp -p"
  55. none:
  56. @echo "Please do"
  57. @echo " make PLATFORM"
  58. @echo "where PLATFORM is one of these:"
  59. @echo " $(PLATS)"
  60. @echo "See INSTALL for complete instructions."
  61. # make may get confused with test/ and INSTALL in a case-insensitive OS
  62. dummy:
  63. # echo config parameters
  64. echo:
  65. @echo ""
  66. @echo "These are the parameters currently set in src/Makefile to build Lua $V:"
  67. @echo ""
  68. @cd src && $(MAKE) -s echo
  69. @echo ""
  70. @echo "These are the parameters currently set in Makefile to install Lua $V:"
  71. @echo ""
  72. @echo "PLAT = $(PLAT)"
  73. @echo "INSTALL_TOP = $(INSTALL_TOP)"
  74. @echo "INSTALL_BIN = $(INSTALL_BIN)"
  75. @echo "INSTALL_INC = $(INSTALL_INC)"
  76. @echo "INSTALL_LIB = $(INSTALL_LIB)"
  77. @echo "INSTALL_MAN = $(INSTALL_MAN)"
  78. @echo "INSTALL_LMOD = $(INSTALL_LMOD)"
  79. @echo "INSTALL_CMOD = $(INSTALL_CMOD)"
  80. @echo "INSTALL_EXEC = $(INSTALL_EXEC)"
  81. @echo "INSTALL_DATA = $(INSTALL_DATA)"
  82. @echo ""
  83. @echo "See also src/luaconf.h ."
  84. @echo ""
  85. # echo private config parameters
  86. pecho:
  87. @echo "V = $(V)"
  88. @echo "TO_BIN = $(TO_BIN)"
  89. @echo "TO_INC = $(TO_INC)"
  90. @echo "TO_LIB = $(TO_LIB)"
  91. @echo "TO_MAN = $(TO_MAN)"
  92. # echo config parameters as Lua code
  93. # uncomment the last sed expression if you want nil instead of empty strings
  94. lecho:
  95. @echo "-- installation parameters for Lua $V"
  96. @echo "VERSION = '$V'"
  97. @$(MAKE) echo | grep = | sed -e 's/= /= "/' -e 's/$$/"/' #-e 's/""/nil/'
  98. @echo "-- EOF"
  99. # show what has changed since we unpacked
  100. newer:
  101. @$(FIND) . -newer MANIFEST -type f
  102. # list targets that do not create files (but not all makes understand .PHONY)
  103. .PHONY: all $(PLATS) clean test install local none dummy echo pecho lecho newer
  104. # (end of Makefile)