"Makefile 만들기"의 두 판 사이의 차이

 
(사용자 4명의 중간 판 19개는 보이지 않습니다)
7번째 줄: 7번째 줄:
{{참고|make}}
{{참고|make}}


==makefile 이란?==
==Makefile 이란?==
{{참고|makefile}}
{{참고|Makefile}}


==컴파일 예제==
==컴파일 예제==
===파일 개요===
===파일 개요===
*a.c (a.h), b.c (b.h), main.c 파일을 각각 만들어 보자
a.c (a.h), b.c (b.h), main.c 파일 생성
 
[[File:files.png|600px]]
[[File:files.png|600px]]


===파일 코드 내용===
fe
{{소스헤더|a.c}}
<source lang='C'>
#include <stdio.h>
 
void foo()
{
    printf("foo\n");
}
</source>
{{소스헤더|a.h}}
<source lang='C'>
void foo();
</source>
 
{{소스헤더|b.c}}
<source lang='C'>
#include <stdio.h>
 
void bar()
{
    printf("bar\n");
}
</source>
{{소스헤더|b.h}}
<source lang='C'>
void bar();
</source>
 
{{소스헤더|main.c}}
<source lang='C'>
#include "a.h"
#include "b.h"
 
int main()
{
    foo();
    bar();
 
    return 0;
}
</source>
 
===컴파일 하기===
*object 파일 생성
<source lang='console'>
$ gcc -c -o a.o a.c
$ gcc -c -o b.o b.c
$ gcc -c -o main.o main.c
</source>
 
*실행 파일 생성
<source lang='C'>
gcc -o exefile main.o a.o b.o
</source>
 
* 실행파일 실행해보기
<source lang='C'>
$ ./exefile
foo
bar
</source>
 
작성중...


==같이 보기==
==같이 보기==
84번째 줄: 22번째 줄:
* [[makefile]]
* [[makefile]]


[[분류: 작성중]]
[[분류: make]]
[[분류: 컴파일]]
[[분류:빌드]]

2020년 6월 6일 (토) 03:02 기준 최신판

1 개요[ | ]

makefile 만들기
How to make the makefile
  • make 빌드를 위한 makefile 만들기

2 make 란?[ | ]

3 Makefile 이란?[ | ]

4 컴파일 예제[ | ]

4.1 파일 개요[ | ]

a.c (a.h), b.c (b.h), main.c 파일 생성

Files.png

fe

5 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}