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