Chinaunix

标题: Makefile学习小记 [打印本页]

作者: zzly_c    时间: 2008-11-24 22:49
标题: Makefile学习小记
嘿嘿 刚刚开始学习Makefile 花了半天写了才写了一个一次编译目录下所有c文件的Makefile。
Makefile 很是博大精深,好好学,加油~~
#
# Makefile for the **
#
SRCS = $(wildcard test*.c)
OBJS = $(patsubst %c,%o,$(SRCS))
TARGET = $(OBJS)

%o:%c
powerpc-linux-gcc  -o $@ $
.PHONY: all clean

all : $(OBJS)
clean:
@rm -f *.o


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/86510/showart_1663957.html




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2