Chinaunix首页 | 论坛 | 博客
  • 博客访问: 283610
  • 博文数量: 82
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 874
  • 用 户 组: 普通用户
  • 注册时间: 2015-03-21 09:58
个人简介

traveling in cumputer science!!

文章分类

全部博文(82)

文章存档

2016年(13)

2015年(69)

我的朋友

分类: LINUX

2015-03-21 10:34:34

I learn how to build makefile from below:

http://blog.chinaunix.net/uid-23089249-id-2855999.html


This is my first makefile demo!!It's so simple and crube, but i will make if better gradually!!

It's direction:
warrior@warrior:~/CreazyCode/Cproject/test$ ls
demo.c  demo.h  main.c  main.h  makefile

And it's content:
#makefile demo V1.0
#author: warrior
#mail:675979646@qq.com
#date:2015/3/21

CC          := gcc
CFLAGS      := -c -g  -W -Wall
DIR         := ./

SOURCES     := $(shell ls *.c) 
OBJS        := $(patsubst %.c,%.o,$(SOURCES)) 
TARGET      := target

${TARGET} : ${OBJS} 
${CC} ${CFLAGS} -o $@ $^   

%.o : %.c
$(CC)  ${CFLAGS} -o $@ $<


.PHONY : clean
clean :
-rm -f *.o target



阅读(783) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:My understand of "iptables"

给主人留下些什么吧!~~