lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Feb 18, 2002 at 11:26 -0300, Luiz Henrique de Figueiredo wrote:
> 
> Only if you want to do something other than the default. And it's a
> config file, not the Makefile. As far as I can tell, the Makefile is
> pretty standard.  If not, I welcome suggestion on making the
> Makefiles more standard and portable.

I like the Makefiles as they are, but I think one improvement to make
them more Win32-friendly would be to use macros to specify the file
extensions, because the windows conventions are different:

	.o --> .obj
	.a --> .lib
	.so --> .dll

I took a stab at making the Makefiles compatible with "nmake", which
is the version of make that ships with MSVC.  Unfortunately, I think
it's difficult to achieve nmake/GNU Make compatibility; for example
nmake requires a "!" in "!include $(LUA)/config", and the "cd include;
$(MAKE) $@" doesn't work at all, etc.

Personally, I use cygwin under Win32 to make it tolerable, and stock
Lua builds fine with cygwin using the GNU tools and the Unix file
extension conventions.  However, often I need to develop using MSVC
(Microsoft Visual C/C++), to make it easy to distribute executables,
and to be compatible with projects that are Win32-specific.  In these
circumstances I like to use GNU make, but calling the MSVC compiler
and using Win32 file extension conventions.  These are things that can
be accounted for in lua/config.

So, I've made Makefiles for Lua-4.1-work4 which can easily be adapted
to Win32/MSVC by editing lua/config.  I've uploaded it to the wiki as
a PowerPatch so people can have a look at it:
http://www.lua-users.org/wiki/PowerPatches .  By default it should not
affect the Unix build at all (if it does, then that's a bug -- let me
know).  Under Windows, if you have GNU make, you can just edit the
"config" file and build with MSVC by doing "make".  I left comments
for Windows users in the "config" file, as well as an explanation in
the "INSTALL" file.

I'd love to see this get folded into the standard Lua distribution,
since I think it would help Win32 folks in general, without hurting
anyone else.

TODO: I didn't experiment at all with the .so support in the
makefiles.  I'm pretty sure that can be supported without too much
trouble, but I just didn't have time for it this morning.  Also, I
didn't do anything with "make install" under Windows; I'm not sure
what, if anything, would make sense there.

-- 
Thatcher Ulrich <tu@tulrich.com>
http://tulrich.com