原来makefile可以写得如此精简

TARGET = insert_sort
CFLAGS = -g3

all: $(TARGET)


.PHONY:

clean:
        $(RM) $(TARGET) a.out core *.o

 

下面是执行结果...

[root@bs111 pg_019]# make
make: Nothing to be done for `all'.
[root@bs111 pg_019]# make clean
rm -f insert_sort a.out core *.o
[root@bs111 pg_019]# make
cc -g3 insert_sort.c -o insert_sort
insert_sort.c: 在函数 ‘print_results’ 中:
insert_sort.c:59: 警告:隐式声明与内建函数 ‘printf’ 不兼容
[root@bs111 pg_019]# which cc
/usr/bin/cc
[root@bs111 pg_019]# ls -l /usr/bin/cc
lrwxrwxrwx 1 root root 3 2010-07-07 /usr/bin/cc -> gcc

posted on 2012-10-10 15:27  Orz..  阅读(199)  评论(0编辑  收藏  举报

导航