[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: auto-detecting platform in Makefile
- From: Gisle Vanem <gvanem@...>
- Date: Wed, 1 Aug 2018 11:44:08 +0200
Luiz Henrique de Figueiredo wrote:
I've tested it in Linux and macOS but I don't have access to other
platforms. Perhaps some of you do. In particular, I don't know whether
FreeBSD, NetBSD, OpenBSD are all the same.
All contributions welcome. Thanks.
Fails on Win-10 (My 'uname' is from Cygwin, 32-bit):
c:\> make guess
makefile:95: target 'AIX' given more than once in the same rule
makefile:108: target 'FreeBSD' given more than once in the same rule
makefile:113: target 'Linux' given more than once in the same rule
Guessing CYGWIN_NT-10.0-WOW
...
gnumake[1]: *** No rule to make target 'CYGWIN_NT-10.0-WOW'. Stop.
This seems to work:
--- a/Makefile 2018-08-01 09:37:14
+++ b/Makefile 2018-08-01 09:36:47
@@ -26,7 +26,7 @@
# == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
-PLATS= aix bsd c89 freebsd generic guess linux macosx mingw posix solaris
+PLATS= aix bsd c89 freebsd generic guess linux macosx mingw posix solaris CYGWIN_NT-10.0-WOW
LUA_A= liblua.a
CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \
@@ -122,6 +122,11 @@
"SYSCFLAGS=-DLUA_BUILD_AS_DLL" "SYSLIBS=" "SYSLDFLAGS=-s" lua.exe
$(MAKE) "LUAC_T=luac.exe" luac.exe
+CYGWIN_NT-10.0-WOW:
+ $(MAKE) LUA_A=lua53.dll LUA_T=lua.exe 'AR=ar rs' RANLIB= \
+ SYSCFLAGS=-DLUA_BUILD_AS_DLL SYSLIBS= SYSLDFLAGS=-s lua.exe
+ $(MAKE) LUAC_T=luac.exe luac.exe
+
posix:
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_POSIX"
------
Some issue with GNU-make, 4NT or sh that doesn't like all the "X=Y" on
the cmd-line. 'X=Y' works better.
--
--gv