日期:2014-05-16  浏览次数:20577 次

在linux下写了一个简单程序,请问如何写makefile
#include <iostream>
using namespace std;
int main(){
  cout<<"I love linux."<<endl;
}
如何写makefile呢?

------解决方案--------------------
google 跟我一起写makefile
------解决方案--------------------
Python code

CC=g++
CFLAGS=
BIN=a

a: a.cpp
    $(CC) $(CFLAGS) -o $@ $<

clean:
    rm -f *.o $(BIN)

------解决方案--------------------
C/C++ code

objects = g++
edit:
    $(objects) xx.cpp -o xx

------解决方案--------------------
http://www.cnblogs.com/liyanwei/archive/2010/04/29/1723931.html

帮你找了一个,觉得这个还行