Makefile 에러 정리
다음은 make 에 의해서 생성될 수 있는 가장 일반적인 에러들의 리스트이며 그것들이 의미하는 바와 그것들을 고치는 방법에 대한 정보이다.
때때로 make 에러들은, 특별히 명령 스크립트 라인에서 - 접두사가 있을 때나 명령 라인 옵션으로써 -k 가 있을 때, 치명적인 것이 아니다. 치명적인 에러들은 *** 문자열이 그 앞에 붙는다.
에러 메시지들은 모두 프로그램(보통 `make')의 이름이 앞에 붙거나, 에러가 makefile 안에 있는 것이라면 문제를 담고 있는 파일과 라인넘버가 앞에 붙는다.
아래 테이블에서 이런 공통 접두사들이 빠져있다.
- `[foo] Error NN'
- `[foo] signal description'
- 이런 에러들은 실제로
make 에러들이 전혀 아니다. 그들은 make 가 명령 스크립트의 일부로써 호출한 프로그램이, make 가 실패로 해석하는 0이 아닌 에러 코드 (`Error NN') 를 리턴하거나 다른 이상한 스타일로(어떤 종류의 시그널과 함께) 종료하였다는 것을 의미한다. *** 가 메시지에 붙어 있지 않으면 서브프로세스가 실패했지만 makefile 의 그 규칙이 특수 문자 - 를 앞에 달고 있어서 make 가 그 에러를 무시한 것이다. - `missing separator. Stop.'
- 이것은
make 의 일반적인 "Huh?" 에러 메시지이다. 이것은 make 가 makefile 의 이 라이을 파싱하면서 완벽하게 성공하지 못했다는 것을 의미한다. 이것은 기본적으로 "문법 에러(syntax error)" 를 의미한다. 이런 메시지가 나오는 가장 일반적인 이유들 중의 하나는 여러분이 (또는 많은 MS-Windows 에디터들의 경우와 비슷하게, 여러분의 에디터가) TAB 문자 대신에 공백들로 명령 스크립트들을 들여쓰기하려고 하는 것이다. 명령 스크립트에 있는 모든 라인은 반드시 TAB 문자로 시작하는 것을 기억하자. 8개의 공백은 의미가 없다. - `commands commence before first target. Stop.'
- `missing rule before commands. Stop.'
- 이것은 makefile 에서 처음으로 나오는 것이 명령 스크립트의 일부분인 것처럼 보인다는 것을 의미한다: 이것은 TAB 문자로 시작하고 합법적인
make 명령(변수 할당과 같은)처럼 보이지 않는다. 명령 스크립트들은 항상 어떤 타겟과 연결되어 있어야 한다. 두번째 형태는 그 라인이 첫번째 공백문자가 아닌 문자로써 세미콜론을 가진다면 생성된다; make 는 이것을, 어떤 규칙의 "target: dependency" 섹션을 그냥 떠났다는 것으로 해석한다. - `No rule to make target `xxx'.'
- `No rule to make target `xxx', needed by `yyy'.'
- 이것은
make 가 타겟을 빌드할 필요가 있다고 판단했지만 makefile 안에서 그렇게 하는 것에 대한, 명시적 또는 묵시적(디폴트 규칙 데이터베이스를 포함해서) 규칙들(instructions)도 찾을 수 없다는 것을 의미한다. 그 파일이 빌드되기를 원한다면 그 타겟이 빌드되는 방법을 설명하는 규칙을 추가할 필요가 있다. 이 문제의 다른 가능성은 makefile 을 오자(그 파일 이름이 잘못되었다)했거나 소스 트리가 잘못된 경우이다(그 파일이 빌드될 것으로 생각된 것이 아니고 단지 종속물이다). - `No targets specified and no makefile found. Stop.'
- `No targets. Stop.'
- 전자는 명령행에서 빌드될 타겟을 하나도 제공하지 않았고
make 가 읽어들일 makefile 들을 찾을수 없다는 것을 의미한다. 후자는 어떤 makefile 들이 찾아졌으나 디폴트 타겟이 없고 어떤 것도 명령행에서 주어지지 않았다는 것을 의미한다. 이들 경우에 GNU make 는 아무것도 하지 않는다. - `Makefile `xxx' was not found.'
- `Included makefile `xxx' was not found.'
- 명령행에서 주어진 makefile (첫번째 형태) 또는 포함된 makefile (두번째 형태) 가 없다.
- `warning: overriding commands for target `xxx''
- `warning: ignoring old commands for target `xxx''
- GNU
make 는 타겟 하나에 대해서 단 한번만 명령들이 지정되는 것을 허락한다(더블-콜론 규칙들을 제외하고). 이미 명령들을 가지도록 정의된 타겟에 대해서 명령들을 다시 주면 이 경고가 발행되고 두번째 명령들은 첫번째 것을 오버라이드할 것이다. -
- `Circular xxx <- yyy dependency dropped.'
make 가 종속성 그래프에서 루프를 발견했다는 것을 의미한다: 타겟 xxx 의 종속물 yyy, 그리고 이것의 종속물들 등등 을 추적한 후 그들중 하나가 xxx 에 다시 종속한다는 의미이다. -
- `Recursive variable `xxx' references itself (eventually). Stop.'
- 이것은 확장될 때 자기자신(xxx)을 참조할 일반 (재귀적인)
make 변수 xxx 를 정의했다는 것을 의미한다. 이것은 허용되지 않는다; 단순-확장 변수 (:=) 를 사용하든지 아니면 추가 연산자 (+=) 를 사용하자. -
- `Unterminated variable reference. Stop.'
- 이것은, 변수나 함수 참조에서 적절하게 닫는 괄호나 중괄호를 제공하는 것을 잊었다는 것을 의미한다.
-
- `insufficient arguments to function `xxx'. Stop.'
- 이것은 이 함수에 대해서 필요한 개수의 매개변수들을 제공하지 않았다는 것을 의미한다. 매개변수들의 설명에 대해서는 그 함수의 문서를 보자.
- `missing target pattern. Stop.'
- `multiple target patterns. Stop.'
- `target pattern contains no `%'. Stop.'
- 이들은 잘못된 정적 패턴 규칙들에 대해서 생성된다. 첫번째는 규칙의 타겟 섹션에 어떤 패턴도 없다는 것을 의미하고, 두번째는 타겟 섹션에 다수의 패턴들이 있다는 것을 의미하며, 세번째는 타겟이 패턴 문자 (
%) 를 담고 있지 않다는 것을 의미한다.
Makefile:17: *** missing separator. Stop.
Makefile을 작성할 때 명령어(command)부분은 모두 TAB 문자로 시작해야 한다고 첫 번째 장부터 강조하였다. 위의 에러는 TAB 문자를 쓰지 않았기 때문에 make가 명령어인지 아닌지를 구별 못하는 경우이다.
대처: 17번째 줄(근처)에서 명령어가 TAB 문자로 시작하게 바꾼다.
make: *** No rule to make target `io.h', needed by `read.o'. Stop.
위의 에러는 의존 관계에서 문제가 발생했기 때문이다. 즉 read.c가 io.h에 의존한다고 정의되어 있는데, io.h를 찾을 수 없다는 에러이다.
대처: 의존 관계에서 정의된 io.h가 실제로 존재하는지 조사해 본다. 없다면 그 이유를 한번 생각해 본다. make dep를 다시 실행시켜서 의존 관계를 다시 생성시켜 주는 것도 하나의 방법이다.
Makefile:10: *** commands commence before first target. Stop.
위 의 에러는 '첫 번째 타겟이 나오기 전에 명령어가 시작되었다'는 애매한 에러 메시지이다. 필자가 경험한 이 에러의 원인은 주로 긴 문장을 여러 라인에 표시를 하기 위해서 '\'를 사용할 때, 이를 잘못 사용했기 때문인 것 같다. 즉 '\'부분은 라인의 가장 끝문자가 되어야 하는데 실수로 '\'뒤에 스페이스를 몇 개 집어넣으면 여지없이 위의 에러가 발생한다.
대처: 10번째 줄(근처)에서 '\'문자가 있거든 이 문자가 라인의 가장 끝문자가 되도록 한다. 즉 '\'문자 다음에 나오는 글자(스페이스가 대부분) 는 모조리 없애 버린다.
make를 수행시키면 의도했던 실행 파일은 안생기고 이상한 행동만 한다. 가령 make clean 했을 때와 같은 행동을 보인다.
make는 천재가 아니라는 점을 생각해야 한다. make는 Makefile의 내용을 읽다가 첫 번째 타겟으로 보이는 것을 자신이 생성시켜야 할 결과 파일이라고 생각한다. 따라서 clean 부분을 Makefile의 첫번째 타겟으로 정해 버리면 위와 같은 결과가 나타나게 된다.
대처: 예제 7.1에서 all 이라는 필요 없는 타겟을 하나 만들어 두었다. 이것은 make가 all 을 첫 번째 타겟으로 인식시키기 위함이었다. 따라서 자신이 생성시키고 싶은 결과 파일을 첫 번째 타겟이 되게 하던지, 아니면 예제 7.1처럼 all과 같은 더미 타겟(dummy target)을 하나 만들어 둔다. 그리고 make clean, make dep 같은 부분은 Makefile의 끝부분에 만들어 두는 것이 안전하다.
이미 컴파일했던 파일을 고치지 않았는데도 다시 컴파일한다.
이 행동은 make가 의존 관계를 모르기 때문이다. 즉 사용자가 의존 관계를 설정해 주지 않았다는 말이 된다. 따라서 make는 무조건 모든 파일을 컴파일해서 실행 파일을 만드는 일이 자신이 할 일이라고 생각하게 된다.
대처: 목적 파일, 소스 파일, 헤더 파일들의 의존 관계를 설정해 주어야 한다. gccmakedep *.c 라고 하면 Makefile의 뒷부분에 자동적으로 의존 관계를 만들어 준다. 그외의 다른 파일들에 대해서는 사용자가 적절하게 의존 관계를 설정해 주어야 한다.
main.o : main.c io.h
read.o : read.c io.h
write.o : write.c io.h
위의 예제는 첫 번째 장에서도 제시했던 건데... TARGET : DEPENDENCY의 형식으로 의존 관계를 작성한 것이다. (make에게 의존 관계를 알려주는 방법이죠)
- 그 외의 경우에 대해서는 각자가 한번 원인과 결과를 알아보기 바란다. 그리고 팁의 형식으로 글을 올린다면 다른 사람에게도 많은 도움이 될 것이다. 일단 make에서 에러를 내기 시작하면 초보자는 원인조차 모르는 경우가 많기 때문이다.
강좌를 마치면서
이번 make 강좌는 make 유틸리티에 대한 전반적인 이해와 간단한 Makefile 작성을 목적으로 하였습니다. make에 관한 모든 것을 다 소개하지는 않았습니다. (개인적인 능력의 한계 !!) make를 아주 잘 쓰기 위해서는 make 자체에 대한 지식보다는 유닉스(리눅스)의 샐 프로그램과 고난이도(?)의 명령어까지 알고 있어야 하기 때문이죠. 해커가 되려면 이런 지식을 많이 알고 있어야 합니다. 한가지 아쉬운 게 imake에 대해서 설명을 못한 것입니다. imake에 대해서는 make 중급코스란 이름으로 언젠가 강좌를 해보도록 하죠. imake는 Makefile을 생성시켜 준다고 생각하세요)
지 금 make 다음의 강좌로 뭘해야 할지 고민 중입니다. 우선 X 강좌를 하시는 분(아직은 조용하네요)의 강좌의 이해를 높이기 위해서 X의 개념을 2회 정도의 강좌로 할 생각입니다. X 가 왜 X 이고 어떤 특징을 가지고 있는지 한번 살펴보기로 하죠.
원본 : http://wiki.kldp.org/KoreanDoc/html/GNU-Make/GNU-Make-8.html
Trackback address :: http://4ellene.net/tt/trackback/1030
-
Tracked from Payday Ok
2006/12/21 12:00
삭제
Get a Payday Ok Loan
-
Tracked from online poker
2009/03/30 17:51
삭제
poker stars
-
Tracked from extreme fucking
2009/04/13 08:08
삭제
extreme facials
-
Tracked from rape movies
2009/04/14 10:39
삭제
rape links
-
Tracked from free bdsm pics
2009/04/15 02:15
삭제
free bdsm movie galleries
-
Tracked from torture rape
2009/06/29 19:13
삭제
extreme rape
-
Tracked from extreme beast sex
2009/06/30 01:01
삭제
forced stripping
-
Tracked from best rape sites
2009/06/30 01:48
삭제
the rape of nanking
-
Tracked from forced sex comics
2009/06/30 02:16
삭제
forced sex movie
-
Tracked from what is rape
2009/06/30 20:07
삭제
forced sex porn
-
Tracked from porn and rape
2009/06/30 21:44
삭제
mature rape
-
Tracked from rape comix
2009/07/01 13:47
삭제
forced sex stories
-
Tracked from bondage + forced + sex
2009/07/01 22:01
삭제
rape fuck
-
Tracked from rape stories
2009/07/02 05:23
삭제
young girl rape
-
Tracked from rape fetish
2009/07/02 13:36
삭제
young ape anal rape
-
Tracked from extreme porn
2009/07/02 20:33
삭제
sexy rape
-
Tracked from young ape anal rape
2009/07/02 20:53
삭제
extreme board rape
-
Tracked from forced sex pictures
2009/07/03 12:37
삭제
fantasy rape stories
-
Tracked from baby rape
2009/07/03 18:47
삭제
rape story
-
Tracked from forced family sex
2009/07/06 03:08
삭제
lesbian forced sex
-
Tracked from rape incest
2009/07/06 08:43
삭제
how to rape
-
Tracked from fantasy rape fetish porn
2009/07/07 00:00
삭제
daughter rape porn
-
Tracked from girl rape
2009/07/07 20:54
삭제
forced dog sex videos
-
Tracked from 1 hour free us online casinos
2009/07/10 02:21
삭제
play for fun online casino
-
Tracked from the online casino
2009/07/10 04:48
삭제
uk online casinos
-
Tracked from online casinos accepting us players
2009/07/10 06:47
삭제
united states online casino
-
Tracked from online casino game
2009/07/10 06:52
삭제
online casino news
-
Tracked from online betting casinos
2009/07/11 17:21
삭제
no deposit online casino listings usa
-
Tracked from no download casino
2009/07/11 18:24
삭제
online casinos win bonus
-
Tracked from usa online casino
2009/07/11 19:32
삭제
usa accepting casinos
-
Tracked from casino games
2009/07/12 23:59
삭제
vip casin
-
Tracked from us friendly casinos
2009/07/13 00:32
삭제
no download casino
-
Tracked from online casinos accepting us
2009/07/13 02:08
삭제
online casino betting
-
Tracked from free online casino games
2009/07/13 08:24
삭제
us online casino
-
Tracked from no download casino
2009/07/13 17:19
삭제
online casino no deposit bonus
-
Tracked from free online casino games
2009/07/14 00:50
삭제
casino games online
-
Tracked from golden casino http
2009/07/14 01:03
삭제
american online casinos
-
Tracked from online casino for south dakota
2009/07/14 18:45
삭제
internet casino gambling online
-
Tracked from international online casinos
2009/07/14 20:36
삭제
online casinos for us players
-
Tracked from usa casino gaming
2009/07/15 03:42
삭제
virtual casino
-
Tracked from casino bonus
2009/07/15 14:23
삭제
online casino games for mac
-
Tracked from casinos online
2009/07/16 05:42
삭제
casino tour
-
Tracked from free casino online
2009/07/16 14:05
삭제
online casino no depost
-
Tracked from online download casino games blackjack
2009/07/16 19:48
삭제
online casino blackjack
-
Tracked from casino deposit bonus
2009/07/16 23:36
삭제
online casinos for american players
-
Tracked from vip online casino
2009/07/17 05:54
삭제
free online casinos
-
Tracked from no bonus online casinos
2009/07/17 21:27
삭제
internet casino online
-
Tracked from casino party usa
2009/07/18 04:09
삭제
casino free online
-
Tracked from vip casin
2009/07/18 04:30
삭제
free cash online casino
-
Tracked from play poker online
2009/07/18 06:41
삭제
online casino game
-
Tracked from directorio casino online
2009/07/19 03:14
삭제
online casino no deposit bonus
-
Tracked from casino websites
2009/07/19 05:25
삭제
casino game onlino
-
Tracked from online casinos accepting all usa players
2009/07/19 06:03
삭제
online casinos accepting us players
-
Tracked from american online casinos
2009/07/19 07:46
삭제
vip casin
-
Tracked from internet casino gambling online
2009/07/19 19:20
삭제
online casino uk
-
Tracked from casino sites
2009/07/19 23:54
삭제
free online casino games
-
Tracked from transvestite bdsm
2009/07/20 15:04
삭제
shemale escorts
-
Tracked from sweet transvestite
2009/07/20 19:08
삭제
transexual beauty queens 9
-
Tracked from shemale cumshots
2009/07/20 19:09
삭제
hot shemale
-
Tracked from transsexual services
2009/07/21 02:08
삭제
shemale blowjob
-
Tracked from ladyboy galleries
2009/07/21 02:53
삭제
transvestite porn
-
Tracked from shemale movie
2009/07/21 11:58
삭제
futanari manga
-
Tracked from transvestite chat
2009/07/21 14:45
삭제
pictures of transexual woman
-
Tracked from ladyboy jacking off
2009/07/21 21:36
삭제
post op transsexuals
-
Tracked from tranny gallery
2009/07/22 02:01
삭제
shemale fucks guy
-
Tracked from transexual escorts
2009/07/22 07:59
삭제
tranny girls
-
Tracked from hot transexual
2009/07/22 11:55
삭제
futanari sex
-
Tracked from futanari sites
2009/07/22 22:06
삭제
dickgirl futanari
-
Tracked from transvestite diva
2009/07/24 00:54
삭제
ladyboy thumbs
-
Tracked from transsexual sex
2009/07/24 02:08
삭제
beautiful transexuals
-
Tracked from shemale anal
2009/07/24 04:19
삭제
asian ladyboy
-
Tracked from tranny vids
2009/07/24 08:18
삭제
ladyboy crush
-
Tracked from transvestite uk
2009/07/24 16:18
삭제
young shemale
-
Tracked from transvestites porn
2009/07/24 18:59
삭제
transsexual services
-
Tracked from ladyboys galleries
2009/07/25 07:15
삭제
shemale
-
Tracked from daddy fuck me
2009/09/05 23:37
삭제
daughter incest incest
-
Tracked from dad fucking daughter
2009/09/06 02:50
삭제
father daughter sex
-
Tracked from daddy fucks daughter
2009/09/06 10:02
삭제
daughter nude
-
Tracked from mom strips for son
2009/09/06 10:41
삭제
mother daughter fuck
-
Tracked from twin sisters fucking
2009/09/06 14:52
삭제
young incest
-
Tracked from young incest porn
2009/09/07 01:50
삭제
free incest porn videos
-
Tracked from gay incest
2009/09/07 02:11
삭제
gay incest stories
-
Tracked from twin sisters fucking
2009/09/08 12:06
삭제
young incest
-
Tracked from father daughter incest
2009/09/08 21:41
삭제
father fucks daughter
-
Tracked from daughter incest incest
2009/09/08 22:24
삭제
daughter sex
-
Tracked from taboo sex stories
2009/09/09 08:33
삭제
twin sister sex
-
Tracked from sado maso
2009/09/11 01:31
삭제
schoolgirl bondage
-
Tracked from hardcore bondage
2009/09/11 06:01
삭제
latex bondage
-
Tracked from vintage bondage
2009/09/11 06:13
삭제
water torture
-
Tracked from toilet torture
2009/09/12 04:00
삭제
torture
-
Tracked from sex punishment
2009/09/12 10:31
삭제
sex punishment submission stories
-
Tracked from gay domination
2009/09/12 11:25
삭제
genital torture
-
Tracked from amateur bdsm free videos
2009/09/12 12:08
삭제
anal bdsm
-
Tracked from torture video
2009/09/12 20:56
삭제
tranny bdsm
-
Tracked from tube bdsm
2009/09/12 22:06
삭제
vintage bondage
-
Tracked from bondage toys
2009/09/13 04:06
삭제
bondage videos
-
Tracked from pussy torture
2009/09/14 09:36
삭제
rubber bondage
-
Tracked from lesbian domination
2009/09/14 12:54
삭제
lesbian torture
-
Tracked from vintage bondage
2009/09/15 10:20
삭제
water torture
-
Tracked from bondage fix
2009/09/15 21:39
삭제
bondage galleries
-
Tracked from male bdsm
2009/09/16 04:37
삭제
male torture
-
Tracked from bondage
2009/09/16 04:40
삭제
bondage and discipline
-
Tracked from corset torture story
2009/09/16 12:39
삭제
device bondage
-
Tracked from bdsm ws
2009/09/16 15:23
삭제
bondage
-
Tracked from feminine domination
2009/09/17 18:34
삭제
gay bondage
-
Tracked from dad fucking virgin daughter
2009/09/27 11:24
삭제
dad and daughter sex
-
Tracked from sibling sex
2009/09/27 12:15
삭제
dad fucking son
-
Tracked from dad fucks daughter
2009/09/28 20:08
삭제
daddies and sons gay
-
Tracked from lesbian incest
2009/09/29 01:28
삭제
mother daughter incest
-
Tracked from daddies fucking daughters
2009/09/29 13:18
삭제
dad with sis son sex mom
-
Tracked from daughter sex
2009/10/03 05:38
삭제
dad and daughter incest
-
Tracked from dad with sis son sex mom
2009/10/03 05:48
삭제
dad and daughter
-
Tracked from Free Mom And Son Sex
2009/10/04 06:55
삭제
Mom Strips for Son
-
Tracked from free bdsm movie galleries
2009/10/21 20:08
삭제
free bdsm movies
-
Tracked from bdsm cafe
2009/10/22 12:54
삭제
bdsm cartoons
-
Tracked from anal bdsm
2009/10/22 14:20
삭제
anime bdsm
-
Tracked from bondage fuck
2009/10/23 10:21
삭제
bondage fucking
-
Tracked from male bdsm
2009/10/23 17:10
삭제
public bdsm
-
Tracked from bondage girl
2009/10/23 18:42
삭제
bondage girls
Comments List
醫