$NetBSD: patch-Makefile,v 1.4 2021/08/01 12:39:46 nia Exp $

Install tweaks.
macOS linking

--- Makefile.orig	2012-05-08 19:15:00.000000000 +0000
+++ Makefile
@@ -3,7 +3,7 @@
 # To compile with MinGW please run: mingw32-make -f Makefile.mingw
 
 # Include path where lua.h, luaconf.h and lauxlib.h reside:
-INCLUDES= -I/usr/local/include
+INCLUDES=
 
 DEFINES=
 # Use this for the old ARM ABI with swapped FPA doubles.
@@ -11,7 +11,7 @@ DEFINES=
 #DEFINES= -DSWAPPED_DOUBLE
 
 # Lua executable name. Used to find the install path and for testing.
-LUA= lua
+LUA= lua${_LUA_DOT_VERSION}
 
 CC= gcc
 CCOPT= -O2 -fomit-frame-pointer
@@ -30,7 +30,7 @@ all: $(MODSO)
 
 # Alternative target for compiling on Mac OS X:
 macosx:
-	$(MAKE) all "SOCC=MACOSX_DEPLOYMENT_TARGET=10.4 $(CC) -dynamiclib -single_module -undefined dynamic_lookup"
+	$(MAKE) all "SOCC=$(CC)"
 
 $(MODNAME).o: $(MODNAME).c
 	$(CC) $(SOCFLAGS) -c -o $@ $<
@@ -39,7 +39,8 @@ $(MODSO): $(MODNAME).o
 	$(SOCC) $(SOLDFLAGS) -o $@ $<
 
 install: $(MODSO)
-	$(INSTALL) $< `$(INSTALLPATH) $(MODNAME)`
+	${BSD_INSTALL_LIB} ${MODSO} ${DESTDIR}${PREFIX}/${LUA_CDIR}
+	cp -r doc/* ${DESTDIR}${PREFIX}/${LUA_DOCDIR}
 
 test: $(MODSO)
 	@$(LUA) bittest.lua && echo "basic test OK"
