Imported from ../lua-5.1.tar.gz.
[lua.git] / Makefile
blob56a9b665dd925ac55ddc3161273ffc1bc8598c00
1 # makefile for installing Lua
2 # see INSTALL for installation instructions
3 # see src/Makefile and src/luaconf.h for further customization
5 # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
7 # Your platform. See PLATS for possible values.
8 PLAT= none
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.)
14 INSTALL_TOP= /usr/local
15 INSTALL_BIN= $(INSTALL_TOP)/bin
16 INSTALL_INC= $(INSTALL_TOP)/include
17 INSTALL_LIB= $(INSTALL_TOP)/lib
18 INSTALL_MAN= $(INSTALL_TOP)/man/man1
19 INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
20 INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V
22 # How to install. You may prefer "install" instead of "cp" if you have it.
23 # To remove debug information from binaries, use "install -s" in INSTALL_EXEC.
25 INSTALL_EXEC= $(CP)
26 INSTALL_DATA= $(CP)
27 #INSTALL_EXEC= $(INSTALL) -m 0755
28 #INSTALL_DATA= $(INSTALL) -m 0644
30 # Utilities.
31 CP= cp
32 FIND= find
33 INSTALL= install
34 MKDIR= mkdir
35 RANLIB= ranlib
37 # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
39 # Convenience platforms targets.
40 PLATS= aix ansi bsd generic linux macosx mingw posix solaris
42 # What to install.
43 TO_BIN= lua luac
44 TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp
45 TO_LIB= liblua.a
46 TO_MAN= lua.1 luac.1
48 # Lua version. Currently used only for messages.
49 V= 5.1
51 all: $(PLAT)
53 $(PLATS) clean:
54 cd src && $(MAKE) $@
56 test: dummy
57 src/lua test/hello.lua
59 install: dummy
60 cd src && $(MKDIR) -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
61 cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
62 cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
63 cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
64 cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
65 # $(RANLIB) $(INSTALL_LIB)/$(TO_LIB)
67 local:
68 $(MAKE) install INSTALL_TOP=.. INSTALL_EXEC="cp -p" INSTALL_DATA="cp -p"
70 none:
71 @echo "Please do"
72 @echo " make PLATFORM"
73 @echo "where PLATFORM is one of these:"
74 @echo " $(PLATS)"
75 @echo "See INSTALL for complete instructions."
77 # make may get confused with test/ and INSTALL in a case-insensitive OS
78 dummy:
80 # echo config parameters
81 echo:
82 @echo ""
83 @echo "These are the parameters currently set in src/Makefile to build Lua $V:"
84 @echo ""
85 @cd src && $(MAKE) -s echo
86 @echo ""
87 @echo "These are the parameters currently set in Makefile to install Lua $V:"
88 @echo ""
89 @echo "PLAT = $(PLAT)"
90 @echo "INSTALL_TOP = $(INSTALL_TOP)"
91 @echo "INSTALL_BIN = $(INSTALL_BIN)"
92 @echo "INSTALL_INC = $(INSTALL_INC)"
93 @echo "INSTALL_LIB = $(INSTALL_LIB)"
94 @echo "INSTALL_MAN = $(INSTALL_MAN)"
95 @echo "INSTALL_LMOD = $(INSTALL_LMOD)"
96 @echo "INSTALL_CMOD = $(INSTALL_CMOD)"
97 @echo "INSTALL_EXEC = $(INSTALL_EXEC)"
98 @echo "INSTALL_DATA = $(INSTALL_DATA)"
99 @echo ""
100 @echo "See also src/luaconf.h ."
101 @echo ""
103 # echo private config parameters
104 pecho:
105 @echo "V = $(V)"
106 @echo "TO_BIN = $(TO_BIN)"
107 @echo "TO_INC = $(TO_INC)"
108 @echo "TO_LIB = $(TO_LIB)"
109 @echo "TO_MAN = $(TO_MAN)"
111 # echo config parameters as Lua code
112 # uncomment the last sed expression if you want nil instead of empty strings
113 lecho:
114 @echo "-- installation parameters for Lua $V"
115 @echo "VERSION = '$V'"
116 @$(MAKE) echo | grep = | sed -e 's/= /= "/' -e 's/$$/"/' #-e 's/""/nil/'
117 @echo "-- EOF"
119 # show what has changed since we unpacked
120 newer:
121 @$(FIND) . -newer MANIFEST -type f
123 # list targets that do not create files (but not all makes understand .PHONY)
124 .PHONY: all $(PLATS) clean test install local none dummy echo pecho lecho newer
126 # (end of Makefile)