makefile程序的一个简单应用:
///class Test test.h
#include <iostream>
using namespace std;
class Test
{
public:
Test(void) {}
~Test(void) {}
void printf() { cout<<"Test"<<endl; }
}
///main.cpp
#include "test.h"
#include <iostream>
using namespace std;
int main()
{
Test test;
test.print();
return 0;
}
///makefile
edit: main.cpp
g++ -o edit main.o
main.o: test.h
.PHONY : clean
clean:
rm edit main.o