如何在unix里面编译自己已经写好的c程序?

我知道是写一个makefile的脚本文件,可是如何去写这个文件呢?
---------------------------------------------------------------

#makefile
#!/bin/bash
CC=cc

all:program
program:program.o bill.o
$(CC) $^ -o $@ -O -Wall
%.o:%.c
$(CC) -c $< -Wall
clean:
rm -f *.o program

#------------------------------------------------
注意
:下一行缩进是tab而不是空格,否则会出现
makefile:10: *** missing separator. Stop.

Published At
Categories with 服务器类
Tagged with
comments powered by Disqus