Makefile
原文链接:http://www.orlion.ga/816/
一、基本规则
对于一个拥有多个文件的c项目,编译时可能是这样的指令:
gcc main.c stack.c -o main
如果编译之后又对stack.c进行了修改,则又要重新把所有的源文件编译一遍,即使main.c和那些头文件都没有修改也要跟着重新编译,一个大型项目往往上千个源文件组成,全部编译要几个小时,只改一个源文件就要重新编译显然不合理。如果是一下的编译方式会好一些:
gcc -c main.c
gcc -c stack.c
gcc main.o stack.o -o main
如果编译后修改了stack.c要重新编译只需要两步:
gcc -c stack.c
gcc main.o stack.o -o main
这样又有一个问题,如果修改了三个源文件,但是有一个忘记编译了,结果编译完了修改没生效。更复杂的是修改了头文件所有包含该头文件的源文件都需要重新编译。
要解决以上的问题就需要写一个Makefile文件和源码放到同一个目录下:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAg4AAADWCAYAAAC5SQpSAAAgAElEQVR4Ae2dPZIkTVKGezFOAGdgJVCQMEP6BGS0vsOioSPCGVZFpQ+AoWIcYyVOAu1T8055e3v8ZGZkVmTmk2MzEeH/8UTVRFRWVffv/vCHP/zfP/3zv77563/+9L9v//C3v/ci+hUC//Ff//32j3//d18s/vqv/uLLmMG1CPzbv//ntzW/1gyZDQQgAIGcwJ/lYqQQgAAEIAABCEDgO4E/N9Hf/P4vv2uQLCLwL4usMb4CAdb8CqvIHCAAgaUEuOOwlBj2EIAABCAAgRsT2O/g8PHx9mZ/L3Z9fM7J/l7t2ntO4rZ3njXrotrW+M7sMyPrmXmduTY9hlnzM6/ieWrf7+BwHga3r/SI/2ze399vz/lIAEes6ZHzIVedAM+vOh+0Ywn8+IzD2JA/o43aKPTqflS8jZPlCboR4ITurOmEi0JJEIDAtAQeBwdtzlamNmjJNDadZNa3y+sekse/3i7aSGdy9WuxfNyFff+qS5uDZBpbSMkU3uski3bRRjFMrr75RDsfr9T3/rLZI07Mo3HMJXmtlmhjtjGO/NXKp2Une7Xy09japTHk62NlMbxePpmddKW2FcfrFV+ybCyd5ZPe+l7ux5lNS2b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e/h9kUYanZFsJAwAAAABJRU5ErkJggg==" alt="" />
然后在这个目录下运行make编译:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAc0AAACECAYAAADyZXANAAAVQUlEQVR4Ae2dPZIkyXGFBzCegDwDIIEKJZhRWgEytT0ENegUyTOsuir3ADCoMEh7Bko8CWm+Y6/2lY9HZORfVWTlV2YzGeE/zz2+rMrorK7u/s2PP/74fz///POXf//zf37xx9//53+//Olffu8mxh0C//3Xv335t3/941PEH373j09zJp9F4L9+/Ms35/yzVshqIACBTOC32cAcAhCAAAQgAIGawD/I/M+//ycNOW4k8B8b80i7LgHO+XXPHZ1DYAsB7jS3UCMHAhCAAARuSeBxp6nV//TTTxr+cvz++++f5u+YRE+tPnK/0V8V63GV/9Xr6vXT853ZZ9Sdgc3SGo/mc7TeUv9Lfu8nYmc+J97rzH0uMccPgVECzTvNeAHM8CLwF2VelHzqVf3K7vHyue2d414/Pd9ZPVfMzqq1V/doPkfrHbG+Xk9xrnS+fLy37pb8Xp9b9MiBwOwEmpvm7I3THwQgAAEIQODVBL55e7bXgL66ja8uNY74/NWm+6S3NiZraJ51pL/3KH3XybW2xGQN1x8dq27Wkt111sZkDc2zjteoxq28bNfcNbyW/GHTOGI9xnM1VqzifK7xiI70/Oj5LY0cU8WNxHjdauwaeay1V3nZ5rnKk03zyJFN+e6TLR+V47Gyeaz73c4YAjMTWHWnqSe5XgB5Hgt1X/i3xnhu6OZ52PwRdVXb7SNj5anG1p6jVk9jpJccE71t7WdkXepXdfNc9iOOo/1ELY/1edVHjo0YZ+ZrUmyl07Ip3zU9Vpq9uJEY12yN1UP4W+NWbssevam/iPFxb02VnnK9N7dJL9eptLBBYEYCq+40fQH+onD7ncYVA10gjuJQ1RjVjtzoJ/5JR8dRjXfGjfQq3iOxW9eiGmvyW/1s0VpTd21s9KmefCwd+TTvHRV7lbX31oIPAi0CmzdNCbZeIPLf6ZgvGpq/k4EuhOrlFefr6Fqv6Ll1jvJaNG/FL9nf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1nbUzW0DzreI1q3MrLds1dw2vJHzaNI9ZjPFdjxSrO5xqP6EjPj57f0sgxVdxIjNetxq6Rx1p7lYcNAhA4hsCqO029KPVizfNoyX3h3xrjuaGb52HzR9RVbbePjJWnGlt7jlo9jZFeckz0trWfkXWpX9XNc9mPOI72E7U81udVHzk2YpyZr0mxlU7LpnzX9Fhp9uJGYlyzNVYP4W+NW7nYIQCB/QRW3Wl6OX/Buv1O44qBLo5HcahqjGpHbvQT/6Sj46jGO+NGehXvkdita1GNNfmtfrZoralLLAQgcC6BzZum2mpdHOS/01EXRDHR/J0MopfoQ72otzN7OrrWK3pu8chr0bwVv2R/51qWesMPAQgsE1j19uyy3BwRXJiez0PwEJO9F/1n5ffPPnVdLbJ+/lrjVi52CEBgP4FLbZpxkfALhS9fG4Muou47a9zr56yaa3Rzf2LTYijtnCf7yNG1fTySuzVmdF1b9bfkjTAcicm1tdawt8Y5hzkEIHAcgW9+92y+0PkLs+fzlnJc+Fwn5iMxERcPj92q4xqhuUUnayzpRA3lLNVzv3JcX7ZWXMTGw/0xV16M9cgxsntsK0ax1VH5ys3zyJHN8xVf+d2nHNeQXzbNK62wub/Sq2KkLZ/mriWbNBXr85GYiM9xXsf9YVdsjvG6jCEAgeMIfLNpHieNEgTeS4AN5b38qQ6BTySw+4NAnwiFNUHg0wnoC4reOrl77dHBd1cCl/qe5l1PEuteT8A3BR+vVyIDAhCAwK8EuNP8lQWjDyLAXVL/ZMKnzwcvBFoEuNNskcEOAQhAAAIQSATYNBMQphCAAAQgAIEWgf8HDuSrQgx6DFQAAAAASUVORK5CYII=" alt="" />
make命令会自动读取当前目录下的Makefile文件,完成相应的编译步骤。Makefile由一组规则组成,每条规则的格式是:
target ... : prerequisites ...
command1
command2
...
例如:
main: main.o stack.o is_empty.o pop.o push.o
gcc main.o stack.o is_empty.o pop.o push.o
main是这条规则的目标(target),main.o、stack.o、is_empty、pop.o、push.o是这条规则的条件(prerequisite)。目标和条件之间的关系是:欲更新目标,必须更新它的所有条件;所有条件中只要有一个条件被更新了,目标也必须跟着被更新。所谓"更新"就是执行一遍规则中的命令列表,命令列表中的每条命令必须以一个Tab开头,注意不能是空格,对于Makefile中的每个一Tab开头的命令,make会创建一个Shell进程去执行它。
对于上边的例子,make执行如下步骤:
尝试更新Makefile中的第一条规则的目标main,第一条规则的目标称之为缺省目标,只要缺省目标更新了就算完成任务了,其他工作都是为这个目的而做的。由于main文件还没有生成,显然需要更新,但规则说必须先更新了main.o stack.o is_empty.o pop.o push.o这五个条件才能更新main。
所以make会进一步查找以这五个条件为目标的规则,这些目标文件也没有生成,页需要更新,所以执行相应的命令(gcc -c main.c gcc -c stack.c …)来更新它们。
最后执行gcc main.o stack.o is_empty.o pop.o push.o -o main更新main。
如果再执行make则不会重新编译,如果源文件修改了则会重新编译更新对应的目标文件然后重新执行gcc main.o stack.o is_empty.o pop.o push.o -o main来更新main
通常Makefile都会有一个clean规则,用于清除编译过程中产生的二进制文件,保留源文件:
clean:
@echo "cleanning project"
-rm main *.o
@echo "clean completed"
把这条规则加到Makefile文件尾,然后执行这条规则:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoQAAABsCAYAAADzP6OJAAAXZklEQVR4Ae2dC5LbOLJFp1/MxryJ3oNXVHvoTc6LdMctX6UTIAiCEikdRbgJ5Odm4kAuoqmq8l8/f/7839fX1394QQACEIAABCAAAQh8JoH/+rL/+ecfn/7n77//fpi/YhI9tfrI/UZ/VazHVf5nr6vXT893Zp9R9wpstta4ms9qva3+t/zeT8ReeU+81yv1edW+tvYePwQgAIFXEvi/qnh8cb/CF3j/wp77lE+9ql/ZPV4+t71y3Oun5zur54rZWbWO6q7ms1pvxfp6PcVeab98fLTuTH6vzxm9VTlX7WvV+tCBAAQgcAaB8kB4RiE0IQABCEAAAhCAAASuSeDhI+Nei3oqEf/3rXHE5/8bd5/09sZkDc2zjvSPXqXvOrnWTEzWcP3RsepmLdldZ29M1tA863iNatzKy3bNXcNryR82jSPWYzxXY8Uq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),则更新这个目标,如果不指定目标则更新Makefile中第一条规则的目标(缺省目标)。
如果make执行的命令前面加了@字符则不显示命令本身而只显示它的结果;如果命令前面加了“-”即使这条命令出错make也会继续执行,(如果不加则会立刻终止,不再执行后续的命令)通常rm命令和mkdir命令前面要加“-”,因为rm要删除的文件可能不存在,mkdir要创建的目录可能已经存在了,而这些错误是可以忽略的,例如上边已经执行过一遍make clean了,再执行一遍就没有文件可以删了这时rm会报错,但是make忽略了这一错误继续执行后边的echo。
如果当前目录下存在一个文件clean会怎么样呢?如果存在一个clean文件,clean目标又不依赖于任何条件,make就认为它不需要更新了,而我们希望把clean当做一个特殊的名字使用,不管它存在不存在都要更新,可以添加一条特殊规则,把clean声明为一个伪目标:
.PHONY: clean
这条规则没有命令列表。(这条规则写在clean:规则之后也行)类似于clean这样的命令常见的就是install了(make install)
二、隐含规则和模式规则
Makefile有很多灵活的写法,可以写得更简洁。
一个目标所依赖的所有条件不一定非要写在一条规则中,可以分开来写:
main.o: stack.h main.o: main.c
gcc - c main.c
如果一个目标分来来写则其中只有一条规则允许有命令列表,其他规则应该没有规则列表,否则make会报警并采用最后一条规则的命令列表。
现在我们的Makefile可以改写为:
main: main.o stack.o is_empty.o pop.o push.o
gcc main.o stack.o is_empty.o pop.o push.o -o main
main.o: stack.h main.o: main.c
gcc -c main.c stack.o: stack.c
gcc -c stack.c
... clean:
-rm main *.o
.PHONY: clean
可以看到我们把main.o分开来写,但是这样会显得繁琐了些,这时可以简化:
main: main.o stack.o is_empty.o pop.o push.o
gcc main.o stack.o is_empty.o pop.o push.o -o main
main.o: stack.h clean:
-rm main *.o
.PHONY: clean
但是现在main.o\stack.o\is_empty.o…这五个目标连编译命令没了怎么编译的呢?
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdIAAACGCAYAAABpCAtjAAAXv0lEQVR4Ae2dPbIsSZGFH9isANZAS4yChBnSFZDReg+NNvqIsIZWUekFYKgYyxhpVsKYX+bUO+XPPSIyMjIyMvOUWXd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WavZs7HM0FwEROJ7A29/a9Tc/frGWfNymjzMf69i8Jcbi7MGxvTqsYZo9Ol6jpmM1kFOrx37ksD5sWZzF2oP9NkeejfHwMbBzbBaD2OiKfOT6ueXAxvmIj/zsQw5rwA8b5pGW2dgf6UUx0IYPc9aCDZqI5XlLjMX7OK7DfrMj1sdwXY1FQASOJ/B2kB5fThVEYA4BHTJzOKuKCIjAly+7fthIAEVABK5HAF9klDrXu9wSHflE4J3AZb5H+t62ZiKQE+CDgsd5hjwiIAIi0E9A70j72SlzUQJ6N1XeGPEp85FXBLYS0DvSrcQULwIiIAIiIAJEQAcpwdBQBERABERABLYS0EG6lZjiRUAEREAERIAI/B8RfXQuLw7V3wAAAABJRU5ErkJggg==" alt="" />
解释一下前五条命令怎么来的:如果一个目标在Makefile中所有规则都没有命令列表,make会尝试在内建的隐含规则数据库中查找适用的规则。make的隐含规则数据库可以用"make -p"命令打印,打印出来的格式也是Makefile的格式,包含很多变量和规则,其中和这个例子有关的隐含规则有:
# default
OUTPUT_OPTION = -o $@
# default
CC = cc
# default
COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
%.o: %.c
# commands to execute (built-in):
$(COMPILE.c) $(OUTPUT_OPTION) $<
#号在Makefile中表示单行注释,cc是一个Makefile变量,用CC = cc定义和赋值,用$(CC)取它的值,其值应该是cc。Makefile变量像C的宏定义一样,代表一串字符,在取值的地方展开。cc是一个符号链接,通常指向gcc。
CFLAGS这个变量没有定义,$(CFLAGS)展开是空,CPPFLAGS和TARGET_ARCH也是如此。这样$(COMPLIE.c)展开应该是"cc 空 空 空 -c"去掉“空”得到"cc -c",注意中间留下4个空格,所以%.o:%.c规则的命令$(COMPLIE.c) $(OUTPUT_OPTION) $<展开之后是cc -c -o $@ $<,和上面的编译命令已经很接近了。
$@和$<是两个特殊的变量,$@的取值为规则中的目标,$<的取值为规则中的第一个条件。$.o:%.c是一种特殊的规则,称为模式规则。现在回顾一下整个过程,在我们的Makefile中以main.o为目标的规则都没有命令列表,所以make会查找隐含规则,发现隐含规则中有这样一条模式规则适用,main.o符合%.c的模式,现在%就代表main(称为main.o这个名字的Stem),再替换到%.c中就是main.c。所以这条规则就相当于:
main.o: main.c
cc -c -o main.o main.c
随后在处理stack.o目标时又用到这条模式规则,这时又相当于:
stack.o: stack.c
cc -c -o stack.o stack.c
其他三个也同样处理。这三条规则可以由make的隐含规则推导出来,所以不必写在Makefile中。
之前我们写的Makefile都是以目标为中心,现在可以以条件为中心:
target1 target2: prerequisite1 prerequisite2
command $< -o $@
这条规则相当于:
target1: prerequisite1 prerequisite2
command prerequisite1 -o target1
target2: prerequisite1 prerequisite2
command prerequisite1 -o target2
三、变量
foo = $(bar)
bar = Huh?
all:
@echo $(foo)
我们执行make将会打印出Huh?。当make读到foo = $(bar)是,确定foo的值是$(bar),但并不立即展开$(bar),然后读到bar = Huh?,确定bar的值是Huh?,然后在执行规则all:的命令列表时才需要展开$(foo),得到$(bar),再展开$(bar),得到Huh?。因此,虽然bar的定义写在foo之后,$(foo)展开还是能够取到$(bar)的值。、
这种特性有好处就是可以把变量的定义推迟到后边。当然可以使用":="运算符make在遇到变量定义时立即展开:
x := foo
y := $(x) bar
all:
@echo "-$(y)-"
还有一个比较有用的赋值运算符是?=,例如foo ?= $(bar)的意思是:如果foo没有定义过,那么?=相当于=,定义foo的值是$(bar),但不立即展开;如果先前已经定义了foo,则什么也不做,不会给foo重新赋值。
+=运算符可以给变量追加值,例如:
objects = main.o
objects += $(foo)
foo = foo.o bar.o
常用的特殊变量:
$@,表示规则中的目标。
$<,表示规则中的第一个条件。
$?,表示规则中所有比目标新的条件,组成一个列表,以空格分隔。
$^,表示规则中的所有条件,组成一个列表,以空格分隔。
四、自动处理头文件的依赖关系
在写main.o、stack.o、is_empty.o、pop.o、push.o这五个目标的规则时要查看源代码,找出它们依赖于哪些头文件,这很容易出错,一是因为有的头文件包含在另一个头文件中,在写规则时很容易遗漏,二是如果以后修改源代码改变了依赖关系,很可能忘记修改Makefile的规则。为了解决这个问题,可以用gcc的-M选项自动生成目标文件和源文件的依赖关系:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAo4AAACxCAYAAABKvTyxAAAgAElEQVR4Ae2dgZbjOI5sd97Zb9yPnJ/c17E1tzsKBZKQRNmyEzonmwQQCARDcqbHWTX1r//6r//637+++moH2oF2oB1oB9qBdqAdaAemDvy/abWL7UA70A60A+1AO9AOtAPtwH8c+G+c+Pe//832/9b/+Z//+S1+RyBNIx1Rr/RlWMdl9Vefa6ZnVrtTp+Y+wZvVGXf7s5tvpX9Vdz3CfsI9WZ1pRx1foh+j/I6ZVY4naKhqbVw70A60Azsc+OMTR31zjt+gdww6ysE35KyPGlrRS957qHnunfuZnlntLs2ZZ3fNusq725/dfDvON9Oke8X98v3VuZ/Sz9ml1/efor91tgPtQDvwDQ78/YnjNxymz9AOtAPf7cDT3jDO3uh/953o07UD7cBPdaD0xpFv1vomyV6GxW+aXsPQo5jIQRx54L+6wu88cdYZTORw/uqeuZGLvPMcxUQO4sjjM7L9qC/miZ3DZ1FXjr2wjvFe9mDBecy+wgOfr94/4oiYDFfB+Nxs7xxxz9mzvizn/e638zgGDq8rV8HQ+4TV9XIWcsTZubzm56BXuYihpjz7DOd8o733g4nzyPfaDrQD7cDdDvzrrwH/97eq+eY0+oZEXYL8myF46sTCxVyMM4xyujLsr8rvNXDUfD45MLGW5WMuxuLMcsy6WodbPNJLjPYYZ/MqGPXpyrC/KrX/jvo973tYZzlhsrMr732+V40r5mMMTuustsJlvTEX48rMrCf2jTCuOdvHvhjHOXBEXIxHffRfWX3WaF/hp3eE5TXmdXqymnCzeqzF2OeM9llPlhv1d74daAfagd0OlD5x9KGjb6CO+fZ95gHfzHedPZtR5Vav9OgLHtYqxztxFa34XcGePQszjvSP9JzhOjL3buzoXD63gnE8+5E3GV+Wg6e6ioOZvqefGvHT1h0ePO1MracdaAc+x4HDbxw5Wn/zwok/P3V4wg8efiCi5RX3a/esV2j+5y7+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tQDuQO/D/ARy5wmQE0c1UAAAAAElFTkSuQmCC" alt="" />
如果不需要输出系统头文件的依赖可以使用"-MM"。
接下来是怎么把这些规则包含到Makefile中,GNU make官方手册建议这样写:
all: main
main: main.o stack.o is_empty.o pop.o push.o
gcc $^ -o $@
clean:
-rm main *.o
.PHONY: clean
sources = main.c stack.c is_empty.c pop.c push.c
include $(sources:.c=.d)
%.d: %.c
set -e; rm -f $@; \
$(CC) -MM $(CPPFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
source变量包含我们要编译的所有.c文件,$(sources: .c=.d)是一个变量替换语法,把sources变量中每一项的.c替换成.d所以include这一句相当于:
include main.d stack.d is_empty.d pop.d push.d
这里include表示包含五个文件。这五个文件也应该符合Makefile的语法。这时候执行make一开始找不到.d文件会报警告,但是make会把include的文件名也当做目标来尝试更新,而这些目标适用模式规则%.d:%.c,所以执行它的命令列表。
不管是Makefile本事还是被包含的文件,只要有一个文件在make过程中给更新了,make就会重新读取整个Makefile以及被它包含的所有文件。
五、常用的make命令行选项
-n选项只打印要执行的命令,而不会真的执行命令,这个选项有助于我们检查Makefile写得是否正确,由于Makefile不是顺序执行的,用这个选项可以先看看命令的执行顺序,确认无误了再真正执行命令。
-C选项可以切换到另一个目录执行那个目录下的Makefile,比如先退到上一级目录再执行我们的Makefile(假设我们的源代码都放在testmake目录下):
$ cd ..
$ make -C testmake
一些规模较大的项目会把不同的模块或子系统的源代码放在不同的子目录中,然后在每个子目录下都写一个该目录的Makefile,然后在一个总的Makefile中用make -C命令执行每个子目录下的Makefile。
在make命令行也可以用=或:=定义变量,如果这次编译我想加调试选项-g,但我不想每次编译都加-g选项,可以在命令行定义CFLAGS变量,而不必修改Makefile编译完了再改回来:
make CFLAGS=-g
Makefile的更多相关文章
- 说说Makefile那些事儿
说说Makefile那些事儿 |扬说|透过现象看本质 工作至今,一直对Makefile半知半解.突然某天幡然醒悟,觉得此举极为不妥,只得洗心革面从头学来,以前许多不明觉厉之处顿时茅塞顿开,想想好记性不 ...
- 编写一个通用的Makefile文件
1.1在这之前,我们需要了解程序的编译过程 a.预处理:检查语法错误,展开宏,包含头文件等 b.编译:*.c-->*.S c.汇编:*.S-->*.o d.链接:.o +库文件=*.exe ...
- 编写简单的Makefile文件
makefile中的编写内容如下: www:hello.c x.h gcc hello.c -o hello clean: rm hello www:hello.c x.h 表示生成www这个文件需 ...
- 简单编写Makefile
相信很多朋友都有过这样的经历,看着开源项目中好几页的makefile文件,不知所云.在日常学习和工作中,也有意无意的去回避makefile,能改就不写,能用ide就用ide.其实makefile并没有 ...
- [转]Linux中configure/makefile
本文教你如何使用autoconf.automake等来制作一个以源代码形式(.tar.gz)发布的软件.并可在执行configure时使用自定义参数. 一.概述和基础知识 在Linux下得到一个以源代 ...
- Linux内核配置、编译及Makefile简述
Hi,大家好!我是CrazyCatJack.最近在学习Linux内核的配置.编译及Makefile文件.今天总结一下学习成果,分享给大家^_^ 1.解压缩打补丁 首先是解压缩你获取到的Linux内核. ...
- make 查找的文件名顺序为:“GNUmakefile”、“makefile”、“Makefile”
默认的情况下,make会在工作目录(执行make的目录)下按照文件名顺序寻找makefile文件读取并执行,查找的文件名顺序为:“GNUmakefile”.“makefile”.“Makefile”. ...
- 实例:对2个Makefile的备注
实例1:Makefile编译链接简单.c函数 example.c Makefile exe: example.c gcc example.c -o exe clean: rm exe 执行效果: 实例 ...
- Linux中C程序调试、makefile
gcc基本语法格式:gcc [-选项] 源文件 [-选项] 目标文件,GCC编译C程序的过程: 预处理:gcc -E hello.c hello.i.-E指定执行到预处理结束,下面类似. 编译:gcc ...
- Linux工具入门:make工具与Makefile文件
1. make工具 利用make工具可以自动完成编译工作,这些工作包括: 如果修改了某几个源文件,则只重新编译这几个源文件 如果某个头文件被修改了,则重新编译所有包含该头文件的源文件 利用这种自动编译 ...
随机推荐
- Qt下的udp编程
项目需要一个基于udp的客户端, 看着Qt是有个QUdpSocket的类的, 但自带的例子和类的说明都没咋说明白: 怎么用一个QUdpSocket既当发送端, 又当接收端? 谷歌一顿后, 发现很多老内 ...
- c#List移除列表中的元素
对于一个List<T>对象来说移除其中的元素是常用的功能.自己总结了一下,列出自己所知的几种方法. class Program { static void Main(string[] ar ...
- 谈 CSS 模块化
以前看过模块化的相关资料以及解释,对模块化有了一个表皮的了解,自己也做了一些相关的实践,由于接触到的项目交小,所以也没能更好的去体现和理解模块化,但总体还是有那么一些感悟,但是如果要说怎么才能算是好的 ...
- 一个flex buider 3 在eclipse下不能编译的问题解决
今天处理一个遗留的项目:项目使用了flex作为界面,装好flex Builder 3 并添加插件到eclipse,eclipse使用3.7版本. 导入项目,编译,发现编译时候出现 Errors run ...
- CSS Sticky Footer
----CSS Sticky Footer 当正文内容很少时,底部位于窗口最下面.当改变窗口高度时,不会出现重叠问题. ----另一个解决方法是使用:flexBox布局 http://www.w3c ...
- RecyclerView添加Header的正确方式
原文链接:http://blog.csdn.net/qibin0506/article/details/49716795 看了一下博客目录,已经有好几篇博客是关于RecyclerView的,不过对于这 ...
- PHP基础知识之类
类中的方法访问方式: class A{ function foo() { }} 1.A::foo(); 2.$a = new A(); $a->foo(); 3 ...
- 使用CSS3制作三角形小图标
话不多说,直接写代码,希望能够对大家有所帮助! 1.html代码如下: <a href="#" class="usetohover"> <di ...
- Webpack教程
打开链接:Webpack教程
- .NET中使用APlayer组件自制播放器
目录 说明 APlayer介绍 APlayer具备功能 APlayer使用 自制播放器Demo 未完成工作 源码下载 说明 由于需求原因,需要在项目中(桌面程序)集成一个在线播放视频的功能.大概要具备 ...