makefile

来源:互联网 发布:淘宝91邀请码多少钱 编辑:程序博客网 时间:2024/05/01 11:22

target : *.o 

g++ -o target  *.o

*.o: *.c

       g++ -c *.o *.c *.h

=======================

# a sample

# makefile ver2.0 4/22/2014 add macro
# $@ name of the target
# $^ name of all prerequisites with duplicates removed
# $< name of the first prerequisite


CC      = g++


all: Calc clean


Calc: InsrFund.o calc.o
        $(CC) -o Calc calc.o InsrFund.o
calc.o: calc.cpp InsrFund.h
        $(CC) -c calc.cpp
InsrFund.o: InsrFund.cpp InsrFund.h
        $(CC) -c InsrFund.cpp


clean: 
        rm *.o Calc     
~                             

0 0
原创粉丝点击