GNUMake document says

"An argument that contains ‘=’ specifies the value of a variable: ‘v=x’ sets the value of the variable v to x. If you specify a value in this way, all ordinary assignments of the same variable in the makefile are ignored; we say they have been overridden by the command line argument"


This means, value defined as command-line argument has top priority in terms of variable definition.


< Make file >

PRIV_V=hello_OUT

$(info $(PRIV_V))


all: a b

@echo all


a: PRIV_V := hello_A

a:

@echo $(PRIV_V)


b: PRIV_V := hello_B

b:

@echo $(PRIV_V)




< Test >

$ export PRIV_V=ENV

$ make

hello_OUT

hello_A

hello_B

all


$ make PRIV_V=CMD

CMD

CMD

CMD

all


* Tips : Variable definition in gnumake command line.

Variable definition syntax in the Makefile, is also available as command line argument.

Example.

$ make CC=Hello

$ make CC:=Hello

$ make CC+=Hello

function 을 define하는 시점에 default value를 binding한다.

(Spec.을 찾아본건 아니고.. 시험적으로...)



[test.py]


_DEFVAL = 10


def set_def(val):

    global _DEFVAL

    _DEFVAL = val


def prdef(val=_DEFVAL):

    print '+++ ' + str(val) + '\n'


prdef()

set_def(0)

prdef()


============== outputs ==============

+++ 10


+++ 10


'Language > Python' 카테고리의 다른 글

[Python] __iter__ method of class at add operator with list...  (0) 2017.05.19

Let's assume that a engineer is working at same domain for a long time.

Then, based on my experience, relation among those three is something like this.


<Performance/Productivity> = <Talent> * <Time> ^ <Attitude>


What this means?


At early stage, Talent dominates Performance.

But, after all, Attitude dominates Performance.


Then, what is attitude means for engineer?
In my opinion, good attitude of engineer, is
    - studying continuously.
    - trying to establish strong knowledge base for domain.
    - trying to understand as many / deep as possible regarding his/her task and domain.
    .. .and so on.


Let's see below graph.



Y-axis : Performance / Productivity
X-axis : Time

Red line : Talent value = 1, Attitude value = 4
Green line : Talent value = 10, Attitude value = 2



At this graph, there is special period (0 < Time < 1).

At this period, Attitude hinders Performance.

My interpretation is, engineer who has great attitude, always tries to understand nature and fundamental knowledge of tasks.

So, during this period, in terms of so-called output, he/she may be worse than other engineers.

But, based on this strong knowledge and understanding, he/she accelerates productivity (Time > 1)

And finally, his/her performance overcome talent.


This is my opinion based one only my experience.

Reader may or may not agree with it.
But, I strongly believe this. :)




+ Recent posts