boot read

来源:互联网 发布:儿童绘画软件 绿色 编辑:程序博客网 时间:2024/06/06 05:31

http://blog.chinaunix.net/uid-24129645-id-3538147.html

es un nombre bastante largo--------西班牙语 这是一个相当长的名字

=================================

By default, make starts with the first target (not targets whose names start with ‘.’

=================================

The recompilation must be    done if the source file, or any of the header files named as prerequisites, is more recent than the object file,

or if the object file does not exist.

=================================

frob.out: frob.in
@$(frobnicate)----------------------"@"   does not echo any recipe lines

=================================

it will use the recipe ‘cc -c main.c -o main.o’ to compile ‘main.c’ into ‘main.o’.

We can therefore omit the recipes from the rules for the object files.

==================================

immediate : immediate ; deferred
deferred


immediate = deferred
immediate ?= deferred
immediate := immediate
immediate ::= immediate
immediate += deferred or immediate

immediate != immediate

define immediate
deferred
endef
define immediate =
deferred
endef
define immediate ?=
deferred
endef
define immediate :=
immediate
endef
define immediate ::=
immediate
endef
define immediate +=
deferred or immediate
endef
define immediate !=
immediate
endef




=====================================

An explicit rule says when and how to remake one or more files, called the rule’s targets.
It lists the other files that the targets depend on, called the prerequisites of the target,
and may also give a recipe to use to create or update the targets. See Chapter 4
[Writing Rules], page 21.
 An implicit rule says when and how to remake a class of files based on their names.
It describes how a target may depend on a file with a name similar to the target and
gives a recipe to create or update such a target. See Chapter 10 [Using Implicit Rules],
page 111.

===============================================

http://osdir.com/ml/help-make-gnu/2011-01/msg00053.html

On Tue, 2011-01-18 at 09:13 +0330, ali hagigat wrote:
> it does not make sense we specify -l 2.5 and then use -l on command
> line, if we write:
> make -l 2.5
> will sub-makes inherit "-l 2.5" from their parent?

It does seem a little silly, but there are cases where it is useful. If
you don't need that feature, then don't use it.

To me, the most obvious use is in recursive make, when you want a
top-level make to have it set, but not a sub-make. If Makefile
contains:
> all: sub-folder
> sub-folder:
> $(MAKE) -C $@ all -l
Then even if we use "-l 2.5" when we call make, the sub make won't have
a load limit.

Inheritance is one possibility; a shell alias is another. If you
don't need this feature, simply don't use it, it makes no harm by
being there, does it?

如果shell alias规定了这个load limit,可以使用-l将其干掉

=======================================================

realpath,abspath,lastword and a couple of more functions were only introduced in GNU Make 3.81 [See ref].

Now you can get the current filename in older versions usingwords andword:

THIS_MAKEFILE:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))

But I am not sure of a workaround for realpath without going to the shell. e.g. this works with make v3.80:

THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)THIS_MAKEFILE:=$(notdir $(THIS_MAKEFILE_PATH))all:        @echo "This makefile is $(THIS_MAKEFILE) in the $(THIS_DIR) directory"

Which gives

$ make -f ../MThis makefile is M in the /home/sandipb directory
如何找到makefile所在的目录呢?

====================================================

If you give ‘-j’ with no numeric argument, meaning to run as many jobs as
possible in parallel, this is passed down, since multiple infinities are no more than one.

多个无穷并不会大于一个无穷

======================================================

The main reason that it's important to look at expressions thisway, and important to understand the order of evaluation, is thatparts of expressions can trigger "side effects." For example, thefunction-call operator invokes a function, which could displaysomething in the output window, play some music, create a disk file,or any manner of thing that a function can do. Other side effects aremore direct: some operators assign values to variables, so evaluatingsuch an operator has the side effect of changing the value in avariable. The important thing to understand is that if any part of anexpression does have a side effect, the effect will occur precisely atthe step in the expression-procedure where that operator is reached.


The behaviour of functions 'if' and 'ifWithoutElse' in Message-Mapping has been changed. We have changed it after we've become aware of the fact that both functions behave inconsistently with the documentation.

This change has some important consequences, which are described in this note.

Let us consider the function 'if'. The situation with 'ifWithoutElse' is analogous to it.

 

There are, in fact, two distinct use-cases for the function 'if':

 

1. One is when the function is used as an if statement. For example, consider this pseudocode:

 

if <condition>

  value = <expression1>

else

  value = <expression2>

end

 

In this case, one expects that the <condition> expression is evaluated first and then, depending on the value of the condition, one of the branch expressions is evaluated and assigned to variable 'value'.

 

2. The second use case is when the function is used as a procedure. In pseudocode:

 

value = if (<condition>, <expression1>, <expression2>)

 

In this case, all three expressions (<condition>, <expression1> and <expression2>) whould be evaluated first and the results of this expressions would be passed to function 'if', which in turn, would return one of them, depending on condition value, to be assigned to 'value' variable. This second use-case is also known in some programming languages as function 'iif'.

 

In Message-Mapping, the analog of evaluating an expression is advancing a pointer on one of the argument queues of a function. It turned out that the function 'if' did not consistently work either way and that the customers need both variants of the function. The SAP Note 1053706 has delivered the first patch to the function 'if'. This patch was not functionally complete and the function 'if' was patched again. The SAP Note 1085331 has delivered the finally fixed function 'if'. With this Note, the function always works as in use-case 2 above. That is, all arguments are evaluated first, then value of one of them is returned. To minimize compatibility problems with old usages, the function makes one exception to this rule: in case when evaluating one of the branches throws an Exception, the function ignores it, if the exception is in the branch that is not selected by condition.

 

This change in behaviour can lead to some of the Message-Mappings producing different results than before implementing the patch.

One common problem situation is when one of the branches of function 'if' contains a User-Defined function that produces side-effects. Like increments and stores a counter in 'GlobalContainer', for example. Such functions will be executed more times than before and will cause the numbering to go awry.




Note that only one of the then-part or the else-part will be evaluated, never
both. Thus, either can contain side-effects (such as shell function calls, etc.)

===============================================================

$(1): $$($(1)_OBJS) $$($(1)_LIBS:%=-l%)

注意数字1和字母l的区别

---------------------------------------------------------------------

This information is primarily useful (other than for your curiosity) to determine if you
want to believe the value of a variable. For example, suppose you have a makefile ‘foo’ that
includes another makefile ‘bar’. You want a variable bletch to be defined in ‘bar’ if you
run the command ‘make -f bar’, even if the environment contains a definition of bletch.
However, if ‘foo’ defined bletch before including ‘bar’, you do not want to override that
definition. This could be done by using an override directive in ‘foo’, giving that definition
precedence over the later definition in ‘bar’; unfortunately, the override directive would
also override any command line definitions. So, ‘bar’ could include:
ifdef bletch
ifeq "$(origin bletch)" "environment"
bletch = barf, gag, etc.
endif
endif

, foo定义bletch,然后foo 包含了 bar, bar中也定义bletch,

foo的bletch使用override所以优先级高于bar中的bletch,

bar没有机会使用override了,但是仍然希望不被环境变量中的bletch掩盖,只能使用orig函数了,

很难从这个逻辑重绕出来,文档只能靠多理解

-----------------------------------------------

and nothing else will be remade on its account. Follow this procedure:

on its account---由于自己本身

===============================

You can also program the makefile to look at additional variables of your own, giving
the user the ability to control other aspects of how the makefile works by changing the
variables.

可以自己编写makefile来check一些自己定义的变量,控制makefile的行为

========================

compiler - just run M-x compile and enter your compile command.

From there on, you can just M-x compile and use the default

M-x编译命令

=============================

Let's say I have a make rule like this (using some fictitious commands):

Code:
%.a: %.b    a_compiler -i title -o $@ $<    gen_indices -i title $< > $*.ix    -mkdir titles/title    mv $*.ix titles/title
It's not so important exactly what happens, only that there are many subcommands.


==============================================

This manual only documents the default rules available on POSIX-basedoperating systems.

Other operating systems, such as VMS, Windows,OS/2, etc. may have different sets of default rules. To see the fulllist of default rules and variables available in your version of GNUmake, run `make -p' in a directory with no makefile.

什么是默认的规则和变量??


===========================
















































































0 0
原创粉丝点击