X
xz
I am a rookie of C++ and got so confused with the Makefile these days.
Could anyone be so kind and give a little sample Makefile for the
following particular example?
Let's say I have the following files describing 4 classes (A, B, C1,
C2) and a test program (test.cpp) which runs a test for classes C1 and
C2.
A.h
A.cpp
B.h
B.cpp
C1.h
C1.cpp
C2.h
C2.cpp
test.cpp
The inhirentance relation among the 4 classes are as follows:
class C1: public B
class C2: public B
class B: public A
i.e. C1 and C1 are both dependent on B while B is dependent on A.
test.cpp depends on C1 and C2 and contains the main() function.
I am on a linux machine(Ubuntu 7.10) and use g++ 4.1 as the compiler.
Then how should I write the Makefile? Thanks a lot in advance!
Could anyone be so kind and give a little sample Makefile for the
following particular example?
Let's say I have the following files describing 4 classes (A, B, C1,
C2) and a test program (test.cpp) which runs a test for classes C1 and
C2.
A.h
A.cpp
B.h
B.cpp
C1.h
C1.cpp
C2.h
C2.cpp
test.cpp
The inhirentance relation among the 4 classes are as follows:
class C1: public B
class C2: public B
class B: public A
i.e. C1 and C1 are both dependent on B while B is dependent on A.
test.cpp depends on C1 and C2 and contains the main() function.
I am on a linux machine(Ubuntu 7.10) and use g++ 4.1 as the compiler.
Then how should I write the Makefile? Thanks a lot in advance!