'프로그램 사용/make, configure'에 해당되는 글 29건

  1. 2022.12.07 cmake ninja, cmake 옵션주기
  2. 2021.01.20 cmake 옵션 확인
  3. 2021.01.19 cmake 빌드 에러시
  4. 2016.06.16 make order
  5. 2016.06.08 make /bin/sh: 1: pushd: not found 에러
  6. 2016.06.08 make 기본셸
  7. 2016.06.04 makefile := = 차이점
  8. 2015.12.18 make 의존성 파일?
  9. 2015.12.18 make 암시적 룰
  10. 2015.12.16 make jobserver unavailable

-G Ninja 하면 Makefile 이 생성되지 않고 build.ninja만 생성된다.

빌드시 자잘한(?) 옵션은 -Doption=value 식으로 주면 ok

cmake.exe -G "Ninja" -DBUILD_TESTING=ON -DCMAKE_CXX_COMPILER=ccache

[링크 : https://github.com/LibVNC/libvncserver/issues/448]

'프로그램 사용 > make, configure' 카테고리의 다른 글

cmake 옵션 확인  (0) 2021.01.20
cmake 빌드 에러시  (0) 2021.01.19
make order  (0) 2016.06.16
make /bin/sh: 1: pushd: not found 에러  (0) 2016.06.08
make 기본셸  (0) 2016.06.08
Posted by 구차니

댓글을 달아 주세요

cmake 시에 -D 플래그로 옵션을 활성화 가능한데

그 플래그 목록을 확인하는 cmake 옵션은 -LA

$ cmake -LAH

 

openCV-4.5.1 에서 하다 보니 무조건 다른 디렉토리에서 빌드 하라고 나오는지라

한번은 cmake 하고 ccmake로 볼 수 있는건지 확인이 좀 필요할 듯.

sudo apt-get install cmake-curses-gui
ccmake ..

[링크 : https://stackoverflow.com/questions/16851084/how-to-list-all-cmake-build-options-and-their-default-values]

'프로그램 사용 > make, configure' 카테고리의 다른 글

cmake ninja, cmake 옵션주기  (0) 2022.12.07
cmake 빌드 에러시  (0) 2021.01.19
make order  (0) 2016.06.16
make /bin/sh: 1: pushd: not found 에러  (0) 2016.06.08
make 기본셸  (0) 2016.06.08
Posted by 구차니

댓글을 달아 주세요

어우.. cmake 너무 시르다..

빌드 하는데 안되면 CMakeCache.txt 파일 삭제하고 재시도 하면 된다.

 

[링크 : https://stackoverflow.com/questions/45518317/in-source-builds-are-not-allowed-in-cmake]

'프로그램 사용 > make, configure' 카테고리의 다른 글

cmake ninja, cmake 옵션주기  (0) 2022.12.07
cmake 옵션 확인  (0) 2021.01.20
make order  (0) 2016.06.16
make /bin/sh: 1: pushd: not found 에러  (0) 2016.06.08
make 기본셸  (0) 2016.06.08
Posted by 구차니

댓글을 달아 주세요

pipeline 다음 룰은 순서대로

이걸 이용하면 병렬처리 룰도 간단해질지도?



release:

    $(MAKE) clean

    $(MAKE) test1


release: | clean test1

[링크 : http://stackoverflow.com/questions/8496135/parallel-makefile-require-depency-ordering]


Occasionally, however, you have a situation where you want to impose a specific ordering on the rules to be invoked without forcing the target to be updated if one of those rules is executed. In that case, you want to define order-only prerequisites. Order-only prerequisites can be specified by placing a pipe symbol (|) in the prerequisites list: any prerequisites to the left of the pipe symbol are normal; any prerequisites to the right are order-only:


targets : normal-prerequisites | order-only-prerequisites

[링크 : https://www.gnu.org/software/make/manual/html_node/Prerequisite-Types.html]


'프로그램 사용 > make, configure' 카테고리의 다른 글

cmake 옵션 확인  (0) 2021.01.20
cmake 빌드 에러시  (0) 2021.01.19
make /bin/sh: 1: pushd: not found 에러  (0) 2016.06.08
make 기본셸  (0) 2016.06.08
makefile := = 차이점  (0) 2016.06.04
Posted by 구차니

댓글을 달아 주세요

가장 간편(?)한 건...

$ sudo ln -s /bin/bash /bin/sh 


그런데 이렇게 건드리는게 옳은건가...


[링크 : https://forums.xilinx.com/.../Trouble-configuring-petalinux-2013-10-bin-sh-1-pushd-not-found/td-p/399843]

'프로그램 사용 > make, configure' 카테고리의 다른 글

cmake 빌드 에러시  (0) 2021.01.19
make order  (0) 2016.06.16
make 기본셸  (0) 2016.06.08
makefile := = 차이점  (0) 2016.06.04
make 의존성 파일?  (0) 2015.12.18
Posted by 구차니

댓글을 달아 주세요

SHELL 변수로 설정되지 않으면 /bin/sh가 되므로

bash에서 지원하는 popd pushd 등이 봉인..

환경 변수 등을 끌어 가지 않으므로.. 결론은 Makefile 별로 설정을 해주어야 한다.



5.3.2 Choosing the Shell

The program used as the shell is taken from the variable SHELL. If this variable is not set in your makefile, the program /bin/sh is used as the shell. The argument(s) passed to the shell are taken from the variable .SHELLFLAGS. The default value of .SHELLFLAGS is -c normally, or -ec in POSIX-conforming mode.

Unlike most variables, the variable SHELL is never set from the environment. This is because the SHELL environment variable is used to specify your personal choice of shell program for interactive use. It would be very bad for personal choices like this to affect the functioning of makefiles. See Variables from the Environment.

Furthermore, when you do set SHELL in your makefile that value is not exported in the environment to recipe lines that make invokes. Instead, the value inherited from the user’s environment, if any, is exported. You can override this behavior by explicitly exporting SHELL (see Communicating Variables to a Sub-make), forcing it to be passed in the environment to recipe lines.

[링크 : https://www.gnu.org/software/make/manual/html_node/Choosing-the-Shell.html]

    [링크 : https://www.gnu.org/software/make/manual/html_node/Variables_002fRecursion.html]

'프로그램 사용 > make, configure' 카테고리의 다른 글

make order  (0) 2016.06.16
make /bin/sh: 1: pushd: not found 에러  (0) 2016.06.08
makefile := = 차이점  (0) 2016.06.04
make 의존성 파일?  (0) 2015.12.18
make 암시적 룰  (0) 2015.12.18
Posted by 구차니

댓글을 달아 주세요


 In short, variables defined with := are expanded once, but variables defined with = are expanded whenever they are used.

[링크 : http://stackoverflow.com/.../whats-the-difference-between-and-in-makefile]


Simply expanded variables are defined by lines using ‘:=’ or ‘::=’ (see Setting Variables). Both forms are equivalent in GNU make; however only the ‘::=’ form is described by the POSIX standard (support for ‘::=’ was added to the POSIX standard in 2012, so older versions of make won’t accept this form either).

[링크 : http://www.gnu.org/software/make/manual/html_node/Flavors.html#Flavors]


https://www.gnu.org/software/make/manual/html_node/Setting.html#Setting


'프로그램 사용 > make, configure' 카테고리의 다른 글

make /bin/sh: 1: pushd: not found 에러  (0) 2016.06.08
make 기본셸  (0) 2016.06.08
make 의존성 파일?  (0) 2015.12.18
make 암시적 룰  (0) 2015.12.18
make jobserver unavailable  (0) 2015.12.16
Posted by 구차니

댓글을 달아 주세요

gcc -M을 통해서 해당 소스가 끌어와야 하는 헤더들의 목록을 얻어낼수 있다.

이걸 이용하여 역으로

make 파일에서 사용해야 하는 헤더들의 목록을 생성해 낼 수 있고

이걸 make dep나 make depend를 통해서 수행하게 된다.


생각해보니.. ifdef로 된거.. option 파일이 아닌

-D 인자를 통해서 gcc -M -Dflag 해주면... 외부에서 소스변경없이 구현이 가능해져서 더 편하려나?


[링크 : http://developinghappiness.com/?p=174]

    [링크 : http://developinghappiness.com/?page_id=222]


[링크 : http://linux.die.net/man/1/gccmakedep]

'프로그램 사용 > make, configure' 카테고리의 다른 글

make 기본셸  (0) 2016.06.08
makefile := = 차이점  (0) 2016.06.04
make 암시적 룰  (0) 2015.12.18
make jobserver unavailable  (0) 2015.12.16
make 아카이브  (0) 2015.12.14
Posted by 구차니

댓글을 달아 주세요

타겟을 만들지 않아도 컴파일 되는 이유... 라고 해야하나?

*.c는 $(CC)를

*.cc나 *.C는 $(CXX)를 이용해서 컴파일 하는데


$(CPPFLAGS) 와 $(CFLAGS)를 인자로 받으니..

여기에 헤더와 링커 경로를 넣어주면 자동으로 알아서 작동하는 마법!


Compiling C programs

n.o is made automatically from n.c with a recipe of the form ‘$(CC) $(CPPFLAGS) $(CFLAGS) -c’.


Compiling C++ programs

n.o is made automatically from n.cc, n.cpp, or n.C with a recipe of the form ‘$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c’. We encourage you to use the suffix ‘.cc’ for C++ source files instead of ‘.C’.


[링크 : http://www.gnu.org/software/make/manual/make.html#Catalogue-of-Rules] 

[링크 : http://korea.gnu.org/manual/4check/make-3.77/ko/make_10.html#SEC91]


패턴 규칙 예제(Pattern Rule Examples)


다음은 make에 의해서 실제로 미리 정의된 패턴 규칙들의 몇가지 예제들이다. 먼저 `.c' 파일들을 `.o' 로 컴파일하는 규칙은:


%.o : %.c

        $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@


[링크 : http://korea.gnu.org/manual/4check/make-3.77/ko/make_10.html#SEC96] 


'프로그램 사용 > make, configure' 카테고리의 다른 글

makefile := = 차이점  (0) 2016.06.04
make 의존성 파일?  (0) 2015.12.18
make jobserver unavailable  (0) 2015.12.16
make 아카이브  (0) 2015.12.14
make 매크로  (0) 2015.12.14
Posted by 구차니

댓글을 달아 주세요

‘warning: jobserver unavailable: using -j1. Add `+' to parent make rule.’


In order for make processes to communicate, the parent will pass information to the child. Since this could result in problems if the child process isn’t actually a make, the parent will only do this if it thinks the child is a make. The parent uses the normal algorithms to determine this (see How the MAKE Variable Works). If the makefile is constructed such that the parent doesn’t know the child is a make process, then the child will receive only part of the information necessary. In this case, the child will generate this warning message and proceed with its build in a sequential manner.


make 프로세스가 통신을 하기 위해서, 부모는 자식에게 정보를 넘겨줄 것이다. 자식 프로세스가 실제로 make를 하지 못하는 문제가 발생하기 전까지, 부모는 자식이 make를 진행 중이라고 생각을 할 것이다. 부모는 이것을 결정하기 위한 일반적인 알고리즘을 사용한다(How the MAKE Variable Works를 볼 것). 만약 makefile이 부모가 자식이 make 프로세스란걸 알지 못 하는 것과 같은 구조로 짜여있을 경우, 자식은 필요한 정보의 일부분만 받게 될 것이다. 이경우, 자식은 이 경고 메시지를 생성하고 자신의 빌드를 순차적인 방법으로 진행할 것이다.


[링크 : https://www.gnu.org/software/make/manual/html_node/Error-Messages.html]


Recursive make commands should always use the variable MAKE, not the explicit command name ‘make’, as shown here:


subsystem:

        cd subdir && $(MAKE)

[링크 : https://www.gnu.org/software/make/manual/html_node/MAKE-Variable.html#MAKE-Variable]



한줄 요약하자면..

병렬 구조로 안짜여졌으니 병렬로 안하겠어! 라는 의미


해결책은..

make -c ... 

이런거 대신

$(MAKE) -c ...

이런식으로 MAKE 변수를 써라.. 인가?



+

Only certain flags go into $(MAKEFLAGS).  -j isn't included because the sub-makes communicate with each other to ensure the appropriate number of jobs are occuring


Also, you should use $(MAKE) instead of make, since $(MAKE) will always evaluate to the correct executable name (which might not be make).

[링크 : http://stackoverflow.com/questions/9147196/makefile-pass-jobs-param-to-sub-makefiles]



The ‘-j’ option is a special case (see Parallel Execution). If you set it to some numeric value ‘N’ and your operating system supports it (most any UNIX system will; others typically won’t), the parent make and all the sub-makes will communicate to ensure that there are only ‘N’ jobs running at the same time between them all. Note that any job that is marked recursive (see Instead of Executing Recipes) doesn’t count against the total jobs (otherwise we could get ‘N’ sub-makes running and have no slots left over for any real work!)


If your operating system doesn’t support the above communication, then ‘-j 1’ is always put into MAKEFLAGS instead of the value you specified. This is because if the ‘-j’ option were passed down to sub-makes, you would get many more jobs running in parallel than you asked for. 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.


If you do not want to pass the other flags down, you must change the value of MAKEFLAGS, like this:


subsystem:

        cd subdir && $(MAKE) MAKEFLAGS=

The command line variable definitions really appear in the variable MAKEOVERRIDES, and MAKEFLAGS contains a reference to this variable. If you do want to pass flags down normally, but don’t want to pass down the command line variable definitions, you can reset MAKEOVERRIDES to empty, like this:


MAKEOVERRIDES =

This is not usually useful to do. However, some systems have a small fixed limit on the size of the environment, and putting so much information into the value of MAKEFLAGS can exceed it. If you see the error message ‘Arg list too long’, this may be the problem. (For strict compliance with POSIX.2, changing MAKEOVERRIDES does not affect MAKEFLAGS if the special target ‘.POSIX’ appears in the makefile. You probably do not care about this.)


A similar variable MFLAGS exists also, for historical compatibility. It has the same value as MAKEFLAGS except that it does not contain the command line variable definitions, and it always begins with a hyphen unless it is empty (MAKEFLAGS begins with a hyphen only when it begins with an option that has no single-letter version, such as ‘--warn-undefined-variables’). MFLAGS was traditionally used explicitly in the recursive make command, like this:


subsystem:

        cd subdir && $(MAKE) $(MFLAGS)

but now MAKEFLAGS makes this usage redundant. If you want your makefiles to be compatible with old make programs, use this technique; it will work fine with more modern make versions too.


[링크 : https://www.gnu.org/.../html_node/Options_002fRecursion.html#Options_002fRecursion]



'프로그램 사용 > make, configure' 카테고리의 다른 글

make 의존성 파일?  (0) 2015.12.18
make 암시적 룰  (0) 2015.12.18
make 아카이브  (0) 2015.12.14
make 매크로  (0) 2015.12.14
make -j -l  (0) 2015.11.30
Posted by 구차니

댓글을 달아 주세요