C
cppaddict
Hi,
If this is off-topic for this group, please let me know a better place
to post (I searched Google groups and couldn't find one myself).
My question is about designing Makefiles. If your application is made
up of A.cpp, B.cpp, C.cpp, etc, is the following a good design for a
Makefile:
<code>
#compile and link
CC=bcc32
#compile only
CCc=bcc32 -c
OBJS=Main.obj A.obj B.obj C.obj
all: $(OBJS)
$(CC) $(OBJS)
Main.obj: Main.cpp
$(CCc) Main.cpp
A.obj: A.cpp A.h
$(CCc) A.cpp
B.obj: B.cpp B.h
$(CCc) B.cpp
C.obj: C.cpp C.h
$(CCc) C.cpp
</code>
I'm just learning about Makefiles, and my real question is, When you
would you ever have a design that is significantly different from the
one above. I know that people often do, but I'm having a hard time
imagining why they would.
Are there any good articles I should read on the subject of designing
Makefiles?
Thanks for any ideas,
cpp
If this is off-topic for this group, please let me know a better place
to post (I searched Google groups and couldn't find one myself).
My question is about designing Makefiles. If your application is made
up of A.cpp, B.cpp, C.cpp, etc, is the following a good design for a
Makefile:
<code>
#compile and link
CC=bcc32
#compile only
CCc=bcc32 -c
OBJS=Main.obj A.obj B.obj C.obj
all: $(OBJS)
$(CC) $(OBJS)
Main.obj: Main.cpp
$(CCc) Main.cpp
A.obj: A.cpp A.h
$(CCc) A.cpp
B.obj: B.cpp B.h
$(CCc) B.cpp
C.obj: C.cpp C.h
$(CCc) C.cpp
</code>
I'm just learning about Makefiles, and my real question is, When you
would you ever have a design that is significantly different from the
one above. I know that people often do, but I'm having a hard time
imagining why they would.
Are there any good articles I should read on the subject of designing
Makefiles?
Thanks for any ideas,
cpp