Not exactly what i had in mind Nick, I know that i might not have been totally clear on my intentions.
Using your makefile as an example i would like to move say UPDATE.C into a directory off the src directory called update, that compiles the update.c file to update.o which is stored in the o directory off of src.
I know i could do this a number of different ways, multiple makefiles that you call from the main makefile is one way, also below is another way that i worked out i could acheive the desired result, but its way slow because its a full recompile each time.
I know there has to be an easier method of doing this, and one thats not so hackish as this one above, as sometimes i like to leave stray .c files laying about that i dont want to have compiled with the wildcard method.
Thanks again
EldhaMUD Game Developments
The_Fury: Lead Developer, Head Coder
http://fury.eldhamud2.org
Amended on Mon 28 Nov 2005 08:33 PM (UTC) by Nick Gammon
Message
I'm not the world's biggest expert on Makefiles, but this seems to work. Don't copy and paste from below as you need tabs at the start of most lines, not spaces. However the changes I think I made are in bold, just copy them into your makefile:
Seeing that we have been talking makefiles, i would like to move some of my .c files into there own directories so that there is less clutter in the /src directory.
Now i really know very little about makefiles and don't have the faintest idea on how to make this work. If anyone could give me a few pointers on how to do this based on the standard smaugfuss makefile would be most apprecated.
Thanks in advance.
EldhaMUD Game Developments
The_Fury: Lead Developer, Head Coder
http://fury.eldhamud2.org
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.