Imported from ../lua-5.0.3.tar.gz.
[lua.git] / Makefile
blob9ab901d4daefedf7fc32c9b693c48bd20b2434c6
1 # makefile for Lua hierarchy
2 # see INSTALL for installation instructions
3 # see config for customization instructions
5 LUA= .
7 include $(LUA)/config
9 # primary targets ("co" and "klean" are used for making the distribution)
10 all clean co klean: dirs
11 cd include; $(MAKE) $@
12 cd src; $(MAKE) $@
13 cd src/lib; $(MAKE) $@
14 cd src/luac; $(MAKE) $@
15 cd src/lua; $(MAKE) $@
17 # in case they were not created during unpacking
18 dirs: bin lib
20 bin lib:
21 mkdir -p $@
23 # simple test to see Lua working
24 test: all
25 bin/lua test/hello.lua
27 # remove debug information from binaries
28 strip:
29 $(STRIP) bin/*
31 # official installation
32 install: all strip
33 mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN)
34 $(INSTALL_EXEC) bin/* $(INSTALL_BIN)
35 $(INSTALL_DATA) include/*.h $(INSTALL_INC)
36 $(INSTALL_DATA) lib/*.a $(INSTALL_LIB)
37 $(INSTALL_DATA) doc/*.1 $(INSTALL_MAN)
39 # shared libraries (for Linux)
40 so:
41 ld -o lib/liblua.so.$V -shared src/*.o
42 ld -o lib/liblualib.so.$V -shared src/lib/*.o
43 cd lib; ln -fs liblua.so.$V liblua.so; ln -fs liblualib.so.$V liblualib.so
45 # binaries using shared libraries
46 sobin:
47 rm -f bin/*
48 cd src/lua; $(MAKE)
49 cd src/luac; $(MAKE)
51 # install shared libraries
52 soinstall:
53 $(INSTALL_EXEC) lib/*.so.* $(INSTALL_LIB)
54 cd $(INSTALL_LIB); ln -fs liblua.so.$V liblua.so; ln -fs liblualib.so.$V liblualib.so
56 # clean shared libraries
57 soclean:
58 rm -f lib/*.so* bin/*
60 # echo config parameters
61 echo:
62 @echo ""
63 @echo "These are the parameters currently set in $(LUA)/config to build Lua $V:"
64 @echo ""
65 @echo "LOADLIB = $(LOADLIB)"
66 @echo "DLLIB = $(DLLIB)"
67 @echo "NUMBER = $(NUMBER)"
68 @echo "POPEN = $(POPEN)"
69 @echo "TMPNAM = $(TMPNAM)"
70 @echo "DEGREES = $(DEGREES)"
71 @echo "USERCONF = $(USERCONF)"
72 @echo "CC = $(CC)"
73 @echo "WARN = $(WARN)"
74 @echo "MYCFLAGS = $(MYCFLAGS)"
75 @echo "MYLDFLAGS = $(MYLDFLAGS)"
76 @echo "EXTRA_LIBS = $(EXTRA_LIBS)"
77 @echo "AR = $(AR)"
78 @echo "RANLIB = $(RANLIB)"
79 @echo "STRIP = $(STRIP)"
80 @echo "INSTALL_ROOT = $(INSTALL_ROOT)"
81 @echo "INSTALL_BIN = $(INSTALL_BIN)"
82 @echo "INSTALL_INC = $(INSTALL_INC)"
83 @echo "INSTALL_LIB = $(INSTALL_LIB)"
84 @echo "INSTALL_MAN = $(INSTALL_MAN)"
85 @echo "INSTALL_EXEC = $(INSTALL_EXEC)"
86 @echo "INSTALL_DATA = $(INSTALL_DATA)"
87 @echo ""
88 @echo "Edit $(LUA)/config if needed to suit your platform and then run make."
89 @echo ""
91 # turn config into Lua code
92 # uncomment the last sed expression if you want nil instead of empty strings
93 lecho:
94 @echo "-- $(LUA)/config for Lua $V"
95 @echo "VERSION = '$(V)'"
96 @make echo | grep = | sed -e 's/= /= "/' -e 's/$$/"/' #-e 's/""/nil/'
97 @echo "-- EOF"
99 newer:
100 @find . -newer MANIFEST -type f
102 # (end of Makefile)