lua-users home
lua-l archive

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


> > 1) The library/archive and object suffixes e.g. ldo.o and liblua.a. Could
> This has been asked before. It can be done, of course, but the Makefiles
> are for Unix, as said in INSTALL.

I can live with it.

> Sorry, you've lost me here. What do you mean?
The make file in lua/ creates lua/bin and lua/lib.
IMHO the makefile that outputs to these should be the makefile that
creates them.
e.g. src/makefile should create lua/lib
lua/luac/makefile should create lib/bin

Thsi would mean that I could execute lua/src/makefile without having to
manually create src/lib or run lua/makefile.

> 
> The only problem I see with this is that we'd have to specify the location
> of objects files. I recall that in the past this was a problem for
> different compilers. Some insisted on saving objects to the current
> directory; others wanted to save them where the source files lived.

The following should solve the problem.

OBJS = src/lapi.o etc
SRCS = src/lapi.c atc

I have not encountered a compiler that does not let you specify the
object location.


> 
> I like the idea of each directory having its own Makefile because it helps
> you when you're doing local changes. (Yes, 5.1 Makefiles will contain full
> dependencies.) However, there is the case for a single Makefile [1] and if
> single, *portable* Makefile makes the whole thing simpler, I'm all for it.

Me too.

> 
> Of course, a simple solution is to have all source files in a single
> directory, that is, not have lib, lua and luac subdirectories in src.
> Is that what you're saying above?

No, I was not, but it is an idea worth considering. The number of files
involved is 8 at a guess. The name conventions clearly separate the 
library files and lua.c and luac.c are obvious. 
The makefile could/would indicate the role of the files. e.g.
OBJCORE = lapi.o etc 
OBJLIB = lbaselib.o etc

Maybe the directory separation is redundant.

One could argue that the directory structure adds to the complexity.

If the Lua source was in one directory (say src) the build instructions
become rather simple; "compile everything in the src/ directory".

IMHO if it reduces documentation requirement then it is simpler and
easier to maintain. 

> 
> Perhaps you or someone else can send me a sample Makefile that would
> replace all those Makefiles. We could then see what is involved.

I have one for nmake, hacked and modified for my addon libraries.
I will redo this for make if you think it would be helpful.  However, the
more I think about the single C source directory the more I like it. It would
simplify some of the make issues.

> [1]  Recursive Make Considered Harmful
>      www.pcug.org.au/~millerp/rmch/recu-make-cons-harm.html

I think I agree with the content. 

db