2011年4月26日 星期二

用Makefile 寫費式數列

a = 0
b = 1
all:
ifeq ($(time),10)
    exit
else
    @echo $a $b
    @make time=$$((time + 1 ))  c=$(a) a=$(b) b=$$(($(a)+$(b)))
endif

這是在看 GNU makefile 的 manual 裡的conditional statement 部份就順手寫的,還可以再精巧嗎?  try try try

沒有留言: