Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3962580
  • 博文数量: 366
  • 博客积分: 9916
  • 博客等级: 中将
  • 技术积分: 7195
  • 用 户 组: 普通用户
  • 注册时间: 2011-05-29 23:27
个人简介

简单!

文章分类

全部博文(366)

文章存档

2013年(51)

2012年(269)

2011年(46)

分类: LINUX

2012-02-09 14:36:55

CROSS_COMPILE=
CC=$(CROSS_COMPILE)gcc
AR=$(CROSS_COMPILE)ar
LD=$(CROSS_COMPILE)ld
export CROSS_COMPILE CC AR LD

CFLAGS += -I$(PWD)/include/ -I$(PWD)/ -Wall  -O2
LDFLAGS += -static
SHARELIB =
export CFLAGS LDFLAGS

TARGET = libjson.a
SRCS = $(wildcard *.c)
OBJS = $(SRCS:.c=.o)

all: $(OBJS)
    @ $(AR) -rc $(TARGET) $(OBJS)
clean:
    @ rm -f *.o *.a
阅读(6026) | 评论(2) | 转发(2) |
给主人留下些什么吧!~~

txgc_wm2013-01-12 20:19:49

遍历所有子目录的Makefile,并运行相应的make target.

#

# Reference http://www.gnu.org/software/make/manual/make.html

#

# 需要排除的目录

exclude_dirs := include bin

# 取得当前子目录深度为1的所有目录名称

dirs := $(shell find . -maxdepth 1 -type d)

dirs := $(basename $(patsubst ./%,%,$(dirs)))

dirs := $(filter-out $(exclude_di