Fundamental of Software Develop/: : Linux System Programming

Makefile과 Make

Jay.P Morgan 2023. 11. 9. 23:42

Linux System에서는 여러 개의 .c 파일을 컴파일&링크하여 하나의 실행 파일로 생성하는 데 사용하는 Tool로 Makefile과 make명령을 제공한다.

 

  Makefile

  컴파일 명령, 소스파일을 컴파일 하는 방법, 링크할 파일, 실행 파일명 등을 설정하는 파일

 

  Make 명령

Makefile을 읽고, 작성된 내용대로 컴파일을 실행하여 실행 파일을 생성한다.

 

리눅스에 make가 설치되어있지 않은 경우, Ubuntu Linux는 아래와 같이 먼저 make를 설치한다.

$ sudo apt install make

 

 

  make명령 사용하기