Linux GCC make文件的写法2
文件在两个文件夹:
inc/hello.h
main/hello.c, main.c, Makefile
文件内容:
hello.h
void hello(char name[]);
hello.c
#include <stdio.h>
void hello(char name[])
{
printf("Hello %s!\n", name);
}
main.c
#include <stdio.h>
#include "../inc/hello.h"
// The second
int main()
{
hello("GCC");
printf("Haha Linux Ubuntu!\n");
return 0;
}
Makefile
# String declaration
objects = main.o hello.o
# Command
app : $(objects)
cc -o app $(objects)
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 ../inc
# Clean the intermediate files
.PHONY : clean
clean :
rm app $(objects)
相关文档:
什么时候需要创建线程池呢?简单的说,如果一个应用需要频繁的创建和销毁线程,而任务执行的时间又非常短,这样线程创建和销毁的带来的开销就不容忽视,这时也是线程池该出场的机会了。如果线程创建和销毁时间相比任务执行时间可以忽略不计,则没有必要使用线程池了。
下面是 ......
Linux下软件的安装与卸载
一、二进制分发软件包的安装与卸载
Linux软件的二进制分发是指事先已经编译好二进制形式的软件包的发布形式,其优点是安装使用容易,缺点则是缺乏灵活性,如果该软件包是为特定的硬件/操作系统平台编译的,那它就不能在另外的平台或环境下正确执行。
1、*.rpm形式的二进制软件包
安装:rpm ......
10.5.2 精通定时器设置
函数alarm设置的定时器只能精确到秒,而以下函数理论上可以精确到微妙:
#include <sys/select.h>
#include <sys/itimer.h>
int getitimer(int which, struct itimerval *value);
int setitimer(int which, const struct itimerval
*value, struct itimerval *ovalue ......
1、在linux下读微软标准的chm文件时,找了好久终于找了一款很不错的软件---KchmViewer
可以通过终端安装:
sudo apt-get install kchmViewer
使用ubuntu的朋友也可以在ubuntu软件中心安装。
2、LibeFetion非常好的第三方免费飞信软件,也有windows版本
官网主页:http://www.libfetion.org/index.php
真的非常好用 ......
用Linux下的LVS软件实现Linux集群
德英
发表于2010年03月15日 18:22
阅读( ......