| 1 | diff --git a/Makefile b/Makefile
|
| 2 | index 7fa91c8..c85ede2 100644
|
| 3 | |
| 4 | |
| 5 | @@ -104,3 +104,18 @@ pc:
|
| 6 | .PHONY: all $(PLATS) help test clean install uninstall local dummy echo pc
|
| 7 |
|
| 8 | # (end of Makefile)
|
| 9 | +
|
| 10 | +# Use libtool for binary installs, etc.
|
| 11 | +
|
| 12 | +export V
|
| 13 | +export LIBTOOL = ../libtool --quiet --tag=CC
|
| 14 | +# See libtool manual about how to set this
|
| 15 | +
|
| 16 | +alpine_clean:
|
| 17 | + cd src; $(MAKE) $@
|
| 18 | +
|
| 19 | +alpine_install:
|
| 20 | + mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB)
|
| 21 | + cd src; $(LIBTOOL) --mode=install $(INSTALL_EXEC) lua luac $(INSTALL_BIN)
|
| 22 | + cd src; $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
|
| 23 | + cd src; $(LIBTOOL) --mode=install $(INSTALL_DATA) liblua.la $(INSTALL_LIB)
|
| 24 | diff --git a/src/Makefile b/src/Makefile
|
| 25 | index 2e7a412..a72f342 100644
|
| 26 | |
| 27 | |
| 28 | @@ -60,10 +60,10 @@ $(LUA_A): $(BASE_O)
|
| 29 | $(AR) $@ $(BASE_O)
|
| 30 | $(RANLIB) $@
|
| 31 |
|
| 32 | -$(LUA_T): $(LUA_O) $(LUA_A)
|
| 33 | +origin$(LUA_T): $(LUA_O) $(LUA_A)
|
| 34 | $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
|
| 35 |
|
| 36 | -$(LUAC_T): $(LUAC_O) $(LUA_A)
|
| 37 | +origin$(LUAC_T): $(LUAC_O) $(LUA_A)
|
| 38 | $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
|
| 39 |
|
| 40 | test:
|
| 41 | @@ -222,4 +222,33 @@ lvm.o: lvm.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
|
| 42 | lzio.o: lzio.c lprefix.h lua.h luaconf.h llimits.h lmem.h lstate.h \
|
| 43 | lobject.h ltm.h lzio.h
|
| 44 |
|
| 45 | +
|
| 46 | +export LIBTOOL = ../libtool --quiet --tag=CC
|
| 47 | +export LIB_VERSION = 0:0:0
|
| 48 | +
|
| 49 | +# The following rules use libtool for compiling and linking in order to
|
| 50 | +# provide shared library support.
|
| 51 | +
|
| 52 | +LIB_NAME = liblua.la
|
| 53 | +LIB_OBJS = $(CORE_O:.o=.lo) $(LIB_O:.o=.lo)
|
| 54 | +
|
| 55 | +%.lo %.o: %.c
|
| 56 | + $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
|
| 57 | +
|
| 58 | +$(LIB_NAME): $(LIB_OBJS)
|
| 59 | + $(LIBTOOL) --mode=link $(CC) -version-info $(LIB_VERSION) -release $(V) \
|
| 60 | + -rpath $(RPATH) $(LDFLAGS) -o $(LIB_NAME) $(LIB_OBJS) $(LIB_LIBS)
|
| 61 | +
|
| 62 | +$(LUA_T): $(LUA_O:.o=.lo) $(LIB_NAME)
|
| 63 | + $(LIBTOOL) --mode=link $(CC) -export-dynamic $(LDFLAGS) -o $@ \
|
| 64 | + $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS)
|
| 65 | +
|
| 66 | +$(LUAC_T): $(LUAC_O:.o=.lo) $(LIB_NAME)
|
| 67 | + $(LIBTOOL) --mode=link $(CC) -static $(LDFLAGS) -o $@ $(LUAC_O:.o=.lo) \
|
| 68 | + $(LIB_NAME)
|
| 69 | +
|
| 70 | +alpine_clean:
|
| 71 | + $(LIBTOOL) --mode=clean $(RM) $(ALL_O:.o=.lo) $(LIB_NAME) lua luac
|
| 72 | +
|
| 73 | +alpine_all: $(LIB_NAME) $(LUA_T) $(LUAC_T)
|
| 74 | # (end of Makefile)
|