I'm trying to figure out how to make the makefile for the following.
I have bookie.c and client.c which should be compiled into separated executables.
I also have one helper.h and helper.c that are needed in both booie.c and client.c

How should I go about for the makefile?
Is it possible to compile the whole thing in just one make file?
How do put the linkage of the header in the makefile?

So all should just make bookie and client. (They should be separate targets in case you only change one of them.) You know which files bookie and helper should depend on. I don't know what this semlib thing is.

If you want to see the scripts that are used in this one, just let me know and I'll PM them to you.

11-12-2008

matsp

Quote:

Originally Posted by tabstop

So all should just make bookie and client. (They should be separate targets in case you only change one of them.) You know which files bookie and helper should depend on. I don't know what this semlib thing is.

(Obviously, you still need the bits that tell make how to make the client and bookie executables).

--
Mats

One problem with this is that if you add any header files to the program, you will have to add that header in the Makefile. If you generate all of the dependencies on-the-fly, you don't have to worry about that portion.

11-12-2008

matsp

Quote:

Originally Posted by Kennedy

One problem with this is that if you add any header files to the program, you will have to add that header in the Makefile. If you generate all of the dependencies on-the-fly, you don't have to worry about that portion.

Sure - but it also makes it harder to understand what is going on, and for a small project it's probably worth the effort to add header files manually.