Line
Link Here
|
0 |
-- a/Makefile |
0 |
++ b/Makefile |
Lines 12-18
Link Here
|
12 |
# LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h. |
12 |
# LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h. |
13 |
INSTALL_TOP= /usr/local |
13 |
INSTALL_TOP= /usr/local |
14 |
INSTALL_BIN= $(INSTALL_TOP)/bin |
14 |
INSTALL_BIN= $(INSTALL_TOP)/bin |
15 |
INSTALL_INC= $(INSTALL_TOP)/include |
15 |
INSTALL_INC= $(INSTALL_TOP)/include/lua$V |
16 |
INSTALL_LIB= $(INSTALL_TOP)/lib |
16 |
INSTALL_LIB= $(INSTALL_TOP)/lib |
17 |
INSTALL_MAN= $(INSTALL_TOP)/man/man1 |
17 |
INSTALL_MAN= $(INSTALL_TOP)/man/man1 |
18 |
INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V |
18 |
INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V |
Lines 104-106
Link Here
|
104 |
.PHONY: all $(PLATS) help test clean install uninstall local dummy echo pc |
104 |
.PHONY: all $(PLATS) help test clean install uninstall local dummy echo pc |
105 |
|
105 |
|
106 |
# (end of Makefile) |
106 |
# (end of Makefile) |
107 |
-- a/src/Makefile |
107 |
|
|
|
108 |
# Use libtool for binary installs, etc. |
109 |
|
110 |
export V |
111 |
export LIBTOOL = $(BROOT)/usr/bin/libtool --quiet --tag=CC |
112 |
# See libtool manual about how to set this |
113 |
|
114 |
gentoo_clean: |
115 |
cd src; $(MAKE) $@ |
116 |
|
117 |
gentoo_install: |
118 |
mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) |
119 |
cd src; $(LIBTOOL) --mode=install $(INSTALL_EXEC) lua$V luac$V $(INSTALL_BIN) |
120 |
cd src; $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC) |
121 |
cd src; $(LIBTOOL) --mode=install $(INSTALL_DATA) liblua$V.la $(INSTALL_LIB) |
|
|
122 |
++ b/src/Makefile |
Lines 37-46
Link Here
|
37 |
LIB_O= lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o |
37 |
LIB_O= lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o |
38 |
BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS) |
38 |
BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS) |
39 |
|
39 |
|
40 |
LUA_T= lua |
40 |
LUA_T= lua$V |
41 |
LUA_O= lua.o |
41 |
LUA_O= lua.o |
42 |
|
42 |
|
43 |
LUAC_T= luac |
43 |
LUAC_T= luac$V |
44 |
LUAC_O= luac.o |
44 |
LUAC_O= luac.o |
45 |
|
45 |
|
46 |
ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O) |
46 |
ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O) |
Lines 60-69
Link Here
|
60 |
$(AR) $@ $(BASE_O) |
60 |
$(AR) $@ $(BASE_O) |
61 |
$(RANLIB) $@ |
61 |
$(RANLIB) $@ |
62 |
|
62 |
|
63 |
$(LUA_T): $(LUA_O) $(LUA_A) |
63 |
origin$(LUA_T): $(LUA_O) $(LUA_A) |
64 |
$(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) |
64 |
$(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) |
65 |
|
65 |
|
66 |
$(LUAC_T): $(LUAC_O) $(LUA_A) |
66 |
origin$(LUAC_T): $(LUAC_O) $(LUA_A) |
67 |
$(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) |
67 |
$(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) |
68 |
|
68 |
|
69 |
test: |
69 |
test: |
Lines 218-220
Link Here
|
218 |
lobject.h ltm.h lzio.h |
218 |
lobject.h ltm.h lzio.h |
219 |
|
219 |
|
220 |
# (end of Makefile) |
220 |
# (end of Makefile) |
|
|
221 |
|
222 |
export LIBTOOL = $(BROOT)/usr/bin/libtool --quiet --tag=CC |
223 |
export LIB_VERSION = 6:1:1 |
224 |
|
225 |
# The following rules use libtool for compiling and linking in order to |
226 |
# provide shared library support. |
227 |
|
228 |
LIB_NAME = liblua$V.la |
229 |
LIB_OBJS = $(CORE_O:.o=.lo) $(LIB_O:.o=.lo) |
230 |
|
231 |
%.lo %.o: %.c |
232 |
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< |
233 |
|
234 |
$(LIB_NAME): $(LIB_OBJS) |
235 |
$(LIBTOOL) --mode=link $(CC) -version-info $(LIB_VERSION) \ |
236 |
-rpath $(RPATH) $(LDFLAGS) -o $(LIB_NAME) $(LIB_OBJS) $(LIB_LIBS) |
237 |
|
238 |
$(LUA_T): $(LUA_O:.o=.lo) $(LIB_NAME) |
239 |
$(LIBTOOL) --mode=link $(CC) -export-dynamic $(LDFLAGS) -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS) |
240 |
|
241 |
$(LUAC_T): $(LUAC_O:.o=.lo) $(LIB_NAME) |
242 |
$(LIBTOOL) --mode=link $(CC) -static $(LDFLAGS) -o $@ $(LUAC_O:.o=.lo) $(LIB_NAME) |
243 |
|
244 |
gentoo_clean: |
245 |
$(LIBTOOL) --mode=clean $(RM) $(ALL_O:.o=.lo) $(LIB_NAME) lua$V luac$V |
246 |
|
247 |
gentoo_all: $(LIB_NAME) $(LUA_T) $(LUAC_T) |