c++Makefile
c++的Makefile和c的Makefile有些不同。
a.cc>b.cc>c.cc对应头文件a.h和b.h

a.h
#ifndef A
#define A

const int num = 10;

class human
{
public:
        int a;
        int arr[num];
        void show();
};


#endif
a.cc
#include "a.h"

void human::show()
{
        for (int i =0; i                 arr[i] = i;
        }
}
b.h
#ifndef B
#define B

#include "a.h"

class man
{
public:
        human a;
        int display();
};

#endif
b.cc
#include "b.h"

int man::display()
{
        a.show();
        return a.arr[4];
}
c.cc
#include
#include "b.h"

int main()
{
        man b;
        std::cout <        return 0;
}
Makefile
object &#61; c.o b.o a.o
c:$(object)
  g&#43;&#43; -o c $(object)
c.o:c.cc
  cc -c c.cc
b.o:b.cc b.h
  cc -c b.cc
a.o:a.cc a.h
  cc -c a.cc
.PHOINY:clean
clean:
  rm c $(object)
c&#43;&#43;的Makefile用的是g&#43;&#43;,而c用的是gcc