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