Linux GCC make文件的写法1
所需文件hello.c, main.c, hello.h, Makefile,在同一个目录下
hello.c:
#include <stdio.h>
void hello(char name[])
{
printf("Hello %s!\n", name);
}
main.c:
#include "stdio.h"
#include "hello.h"
// The second
int main()
{
hello("GCC");
printf("Haha Linux Ubuntu!\n");
return 0;
}
hello.h:
void hello(char name[]);
Makefile(之所以用大写,因为make可以识别Makefile和makefile,用大写可以鲜明一些):
# String declaration
objects = main.o hello.o
# Command
app : $(objects)
cc -o app main.o hello.o
main.o : main.c hello.h
cc -c main.c
hello.o : hello.c stdio.h
cc -c hello.c
# Search paths
vpath %.h /usr/include
# Clean the intermediate files
.PHONY : clean
clean :
rm app $(objects)
相关文档:
【转】Linux内核裁剪的具体步骤
在menuconfig中配置:
详细介绍内核配置选项及删改情况
第一部分:全部删除
Code maturity level options ---> 代码成熟等级选项
[]Prompt for development and/or incomplete code/drivers 默认情况下是选择的,这将会在 ......
什么时候需要创建线程池呢?简单的说,如果一个应用需要频繁的创建和销毁线程,而任务执行的时间又非常短,这样线程创建和销毁的带来的开销就不容忽视,这时也是线程池该出场的机会了。如果线程创建和销毁时间相比任务执行时间可以忽略不计,则没有必要使用线程池了。
下面是 ......
Linux驱动的一些基本操作
Linux内核中定义了很多宏,对硬件端口和寄存器进行操作,从网上搜集了一些宏定义的信息:
1. __REG简单的说就是获得后面所示物理地址映射后的虚拟地址,例如:
#define GPLR0 __REG(0x40E00000) /* GPIO Pin-Level Register GPIO<31:0> */
#define GPL ......
在服务器上写部署项目的脚本 ,需要把上传来的最新的项目解压, 部署 ,启动服务 实现自动化
于是找到最新的文件是第一件事情
就得到了以下脚本
$ ls -lrt | awk '/xmhi/ { f=$NF };END{ print f }'
中间的xmhi是文件所包含的字符串
另外如果要ls出所有的文件名
$ ls -l |awk '{print$9}' ......
用Linux下的LVS软件实现Linux集群
德英
发表于2010年03月15日 18:22
阅读( ......