projects/aports·blob master · refs

71 lines · 2.0 KiB

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