Makefile 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. # Makefile for installing Lua
  2. # See doc/readme.html for installation and customization instructions.
  3. # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
  4. # Your platform. See PLATS for possible values.
  5. PLAT= none
  6. # Where to install. The installation starts in the src and doc directories,
  7. # so take care if INSTALL_TOP is not an absolute path. See the local target.
  8. # You may want to make INSTALL_LMOD and INSTALL_CMOD consistent with
  9. # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h.
  10. INSTALL_TOP= /usr/local
  11. INSTALL_BIN= $(INSTALL_TOP)/bin
  12. INSTALL_INC= $(INSTALL_TOP)/include
  13. INSTALL_LIB= $(INSTALL_TOP)/lib
  14. INSTALL_MAN= $(INSTALL_TOP)/man/man1
  15. INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
  16. INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V
  17. # How to install. If your install program does not support "-p", then
  18. # you may have to run ranlib on the installed liblua.a.
  19. INSTALL= install -p
  20. INSTALL_EXEC= $(INSTALL) -m 0755
  21. INSTALL_DATA= $(INSTALL) -m 0644
  22. #
  23. # If you don't have "install" you can use "cp" instead.
  24. # INSTALL= cp -p
  25. # INSTALL_EXEC= $(INSTALL)
  26. # INSTALL_DATA= $(INSTALL)
  27. # Other utilities.
  28. MKDIR= mkdir -p
  29. RM= rm -f
  30. # == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
  31. # Convenience platforms targets.
  32. PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris
  33. # What to install.
  34. TO_BIN= lua luac
  35. TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
  36. TO_LIB= liblua.a
  37. TO_MAN= lua.1 luac.1
  38. # Lua version and release.
  39. V= 5.3
  40. R= $V.4
  41. # Targets start here.
  42. all: $(PLAT)
  43. $(PLATS) clean:
  44. cd src && $(MAKE) $@
  45. test: dummy
  46. src/lua -v
  47. install: dummy
  48. cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
  49. cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
  50. cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
  51. cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
  52. cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
  53. uninstall:
  54. cd src && cd $(INSTALL_BIN) && $(RM) $(TO_BIN)
  55. cd src && cd $(INSTALL_INC) && $(RM) $(TO_INC)
  56. cd src && cd $(INSTALL_LIB) && $(RM) $(TO_LIB)
  57. cd doc && cd $(INSTALL_MAN) && $(RM) $(TO_MAN)
  58. local:
  59. $(MAKE) install INSTALL_TOP=../install
  60. none:
  61. @echo "Please do 'make PLATFORM' where PLATFORM is one of these:"
  62. @echo " $(PLATS)"
  63. @echo "See doc/readme.html for complete instructions."
  64. # make may get confused with test/ and install/
  65. dummy:
  66. # echo config parameters
  67. echo:
  68. @cd src && $(MAKE) -s echo
  69. @echo "PLAT= $(PLAT)"
  70. @echo "V= $V"
  71. @echo "R= $R"
  72. @echo "TO_BIN= $(TO_BIN)"
  73. @echo "TO_INC= $(TO_INC)"
  74. @echo "TO_LIB= $(TO_LIB)"
  75. @echo "TO_MAN= $(TO_MAN)"
  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 pkg-config data
  86. pc:
  87. @echo "version=$R"
  88. @echo "prefix=$(INSTALL_TOP)"
  89. @echo "libdir=$(INSTALL_LIB)"
  90. @echo "includedir=$(INSTALL_INC)"
  91. # list targets that do not create files (but not all makes understand .PHONY)
  92. .PHONY: all $(PLATS) clean test install local none dummy echo pecho lecho
  93. # (end of Makefile)