makefile 书写
来源:互联网 发布:酷派5263更改网络 编辑:程序博客网 时间:2024/04/30 12:35
#####################################################################
## file : test makefile for build current dir .c ##
## author : jernymy ##
## date-time : 05/06/2010 ##
#####################################################################
CC = gcc
CPP = g++
RM = rm -rf
## debug flag
DBG_ENABLE = 1
## source file path
SRC_PATH := .
## target exec file name
TARGET := test
## get all source files
SRCS += $(wildcard $(SRC_PATH)/*.c)
## all .o based on all .c
OBJS := $(SRCS:.c=.o)
## need libs, add at here
LIBS :=
## used headers file path
INCLUDE_PATH := .
## used include librarys file path
LIBRARY_PATH := /lib
## debug for debug info, when use gdb to debug
ifeq (1, ${DBG_ENABLE})
CFLAGS += -D_DEBUG -O0 -g -DDEBUG=1
endif
## get all include path
CFLAGS += $(foreach dir, $(INCLUDE_PATH), -I$(dir))
## get all library path
LDFLAGS += $(foreach lib, $(LIBRARY_PATH), -L$(lib))
## get all librarys
LDFLAGS += $(foreach lib, $(LIBS), -l$(lib))
all: clean build
build:
$(CC) -c $(CFLAGS) $(SRCS)
$(CC) $(CFLAGS) -o $(TARGET) $(OBJS) $(LDFLAGS)
$(RM) $(OBJS)
clean:
$(RM) $(OBJS) $(TARGET)
- makefile 书写
- makefile书写
- makefile 书写
- Makefile 书写
- Makefile书写规则
- Makefile 书写命令
- Makefile之书写命令()
- MakeFile文件书写格式
- makefile 书写规则重点
- Makefile详解 书写命令
- Makefile书写规则
- Makefile 的书写规则
- makefile书写规则
- Makefile书写规则
- makefile 书写规则一
- Makefile之书写规则
- Makefile之书写命令
- Makefile 书写通用--转载
- POJ 1236 Network of Schools
- 今天刷 堆
- POJ 2186 Popular Cows
- mybatis dtd配置正确xml依然无法自动提醒
- Codevs 1669 运输装备
- makefile 书写
- Codevs 2059 逃出克隆岛
- Codevs 2855 游乐园的迷宫
- TestLink学习八:TestLink1.9.13与Mantis1.2.19集成
- P3375 【模板】KMP字符串匹配
- java数组,List,Set,Map动态和静态初始化
- KMP 算法 学习 整理
- mtk模块编译
- KMP算法 学习例题 POJ 3461Oulipo