ports/lang/lua53/files/patch-src__Makefile
David Naylor 726b26ae8b lang/lua53: update to 5.3.5 (final release for 5.3)
- Cleanup of variables
 - Use the 'bsd' target for build stage
 - Add options to to select interactive command line editing
 - Add options to control debug options
 - Add option for HTML documentation
 - No change log provided upstream

Submitted by:	Russel Haley (russ.haley@gmail.com)
		Andrew Gierth (andrew_tao173.riddles.org.uk)
Differential Revision:	https://reviews.freebsd.org/D13690
2018-08-18 07:41:00 +00:00

58 lines
1.1 KiB
Text

--- src/Makefile.orig 2018-06-25 17:46:36 UTC
+++ src/Makefile
@@ -6,12 +6,13 @@
# Your platform. See PLATS for possible values.
PLAT= none
-CC= gcc -std=gnu99
-CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS)
+CC?= gcc -std=gnu99
+CFLAGS= -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS)
LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
LIBS= -lm $(SYSLIBS) $(MYLIBS)
+SOLIBS= -lm
-AR= ar rcu
+AR= ar
RANLIB= ranlib
RM= rm -f
@@ -19,8 +20,8 @@ SYSCFLAGS=
SYSLDFLAGS=
SYSLIBS=
-MYCFLAGS=
-MYLDFLAGS=
+MYCFLAGS?=
+MYLDFLAGS?=
MYLIBS=
MYOBJS=
@@ -38,12 +39,13 @@ BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
LUA_T= lua
LUA_O= lua.o
+LUA_SO= liblua.so
LUAC_T= luac
LUAC_O= luac.o
ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
+ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO)
ALL_A= $(LUA_A)
# Targets start here.
@@ -55,8 +57,11 @@ o: $(ALL_O)
a: $(ALL_A)
+$(LUA_SO): $(CORE_O) $(LIB_O)
+ $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(MYLDFLAGS) -shared -Wl,-soname=$(LUA_SONAME) $? $(SOLIBS)
+
$(LUA_A): $(BASE_O)
- $(AR) $@ $(BASE_O)
+ $(AR) $(ARFLAGS) $@ $(BASE_O)
$(RANLIB) $@
$(LUA_T): $(LUA_O) $(LUA_A)