.o files can reside anywhere. Once a file is compiled, the source is no
longer needed.
Converting the makefile to use directories is easy.

Follow along:

mkdir act

move act* act/
<editor> Makefile
find all actfiles, and make them:
act/actfiles

EXCEPT for the dependency:

act.move.o:  acts/act.move.c
    $(CC) -c $(CFLAGS) acts/act.move.c

Now, you'll need to change your CFLAGS so that you have the includes in the
correct places.

And compile. Viola.

> 
> 
> <snip>
> files...now what I'm wondering is...how to redo my Makefile 
> so that I can
> put files in directories. For instance, act_move.c and 
> act_enter.c would be
> in one directory, magic.c and magic2.c would be in another. 
> And the .o files
> </snip>
> 
> Yep, you can do this. What I suggest, since I don't know 
> truly myself, is
> d/l a prgram you know has multiple directories and compile 
> it.  Such as
> perl, php, apache, mysql, postgresql, and there are others. 
> What I "think"
> you have to do is create a Makefile for "each" directory 
> residing in each
> directory and call each one from a "main" Makefile. Then, 
> when you compile
> your .o files, you just link them from those directories. I 
> don't think you
> can put ur .o files in different directories than thier src, tho. I do
> believe they have to be in the same dir.

Reply via email to