1 # makefile for Lua hierarchy
2 # see INSTALL for installation instructions
3 # see config for customization instructions
9 # primary targets ("co" and "klean" are used for making the distribution)
10 all clean co klean
: dirs
11 cd
include; $(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
23 # simple test to see Lua working
25 bin
/lua
test/hello.lua
27 # remove debug information from binaries
31 # official installation
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)
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
51 # install shared libraries
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
60 # echo config parameters
63 @echo
"These are the parameters currently set in $(LUA)/config to build Lua $V:"
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)"
73 @echo
"WARN = $(WARN)"
74 @echo
"MYCFLAGS = $(MYCFLAGS)"
75 @echo
"MYLDFLAGS = $(MYLDFLAGS)"
76 @echo
"EXTRA_LIBS = $(EXTRA_LIBS)"
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)"
88 @echo
"Edit $(LUA)/config if needed to suit your platform and then run make."
91 # turn config into Lua code
92 # uncomment the last sed expression if you want nil instead of empty strings
94 @echo
"-- $(LUA)/config for Lua $V"
95 @echo
"VERSION = '$(V)'"
96 @make echo | grep
= | sed
-e
's/= /= "/' -e
's/$$/"/' #-e 's/""/nil/'
100 @find .
-newer MANIFEST
-type f