[질문완료]makefile관련 질문입니다

ytkim4558의 이미지


###-------------------------------------------------------------###
### Program Name : Makefile ###
### ###
### Copyrights ###
### reserved by Bo-kyun Na (bkna@ecs.syr.edu) ###
### ---- IntellActive Research Lab. ---- ###
###-------------------------------------------------------------###
### This file contains the information necessary for ###
### the compiler and linker to create the object file ###
### for library archive in the UNIX. ###
### ###
###-------------------------------------------------------------###
### USAGE: ###
### To run a makefile: make -f libvdo.mk ###
### To clean: make -f libvdo.mk clean ###
###-------------------------------------------------------------###

CC = gcc
WDIR = ../../..

CFLAGS = -Wall -D_REENTRANT
LDLIBS = -L/usr/X11R6/lib -L${WDIR}/lib

### For Gtk+ v1.2
#CFLAGS += `gtk-config --cflags gthread` -DGTK_12
#LDLIBS += `gtk-config --libs gthread`

### For Gtk+ v2.x
CFLAGS += -I/usr/include/gtk-2.0 `pkg-config --cflags gtk+-2.0`
LIBS += -L/usr/lib -L/usr/lib/pkg-config -lglib-2.0 `pkg-config --libs gthread-2.0 gtk+-2.0`

CFLAGS += -DHAVE_BOOLEAN

LDLIBS +=-lm

SRCS = interface.c callback.c record.c main.c callback_ptzf.c
OBJS = ${SRCS:.c=.o}

### ************************************************************************
all : libgui.a clean
### ************************************************************************
libgui.a : ${OBJS}
ar -rsv $@ $?
mv $@ ${WDIR}/lib/

testprog: $(OBJS)
${CC} ${CFLAGS} -o $@ $? $(LFLAGS) ${LIBS}

### ------------------------------------------------------------------------
clean:
rm -f a.out core *.o $(OBJS)
### ************************************************************************

위의 것이 메이크 파일이구요..;
make 명령어만 때려보면..
[root@localhost mouse_click-notebook_popup]# make
rm -f a.out core *.o interface.o callback.o record.o main.o callback_ptzf.o
[root@localhost mouse_click-notebook_popup]# make
gcc -Wall -D_REENTRANT -I/usr/include/gtk-2.0 `pkg-config --cflags gtk+-2.0` -DHAVE_BOOLEAN -c -o interface.o interface.c
interface.c: In function ‘make_hCommandButtons’:
interface.c:75: warning: unused variable ‘fixed011’
interface.c:74: warning: unused variable ‘pixmapWidget_b2’
interface.c:73: warning: unused variable ‘mask_b2’
interface.c:72: warning: unused variable ‘pixmap_b2’
interface.c:70: warning: unused variable ‘fixed010’
interface.c:67: warning: unused variable ‘fixed6’
interface.c:65: warning: unused variable ‘fixed1’
interface.c: In function ‘init_display’:
interface.c:119: warning: unused variable ‘mask_bg’
interface.c:118: warning: unused variable ‘newstyle_bg’
interface.c:118: warning: unused variable ‘style_bg’
interface.c:115: warning: unused variable ‘buttonbox’
gcc -Wall -D_REENTRANT -I/usr/include/gtk-2.0 `pkg-config --cflags gtk+-2.0` -DHAVE_BOOLEAN -c -o callback.o callback.c
callback.c: In function ‘on_mouse_button_event’:
callback.c:1099: warning: unused variable ‘ipe_dir’
callback.c:1099: warning: unused variable ‘fname’
callback.c:1098: warning: unused variable ‘fp’
callback.c:1073: warning: unused variable ‘eventExpose’
callback.c: At top level:
ch01b.xpm:2: warning: ‘ch01b_xpm’ defined but not used
ch02b.xpm:2: warning: ‘ch02b_xpm’ defined but not used
ch03b.xpm:2: warning: ‘ch03b_xpm’ defined but not used
ch04b.xpm:2: warning: ‘ch04b_xpm’ defined but not used
ch05b.xpm:2: warning: ‘ch05b_xpm’ defined but not used
ch06b.xpm:2: warning: ‘ch06b_xpm’ defined but not used
ch07b.xpm:2: warning: ‘ch07b_xpm’ defined but not used
ch08b.xpm:2: warning: ‘ch08b_xpm’ defined but not used
ch09b.xpm:2: warning: ‘ch09b_xpm’ defined but not used
ch10b.xpm:2: warning: ‘ch10b_xpm’ defined but not used
ch11b.xpm:2: warning: ‘ch11b_xpm’ defined but not used
ch12b.xpm:2: warning: ‘ch12b_xpm’ defined but not used
ch13b.xpm:2: warning: ‘ch13b_xpm’ defined but not used
ch14b.xpm:2: warning: ‘ch14b_xpm’ defined but not used
ch15b.xpm:2: warning: ‘ch15b_xpm’ defined but not used
ch16b.xpm:2: warning: ‘ch16b_xpm’ defined but not used
ch17b.xpm:2: warning: ‘ch17b_xpm’ defined but not used
gcc -Wall -D_REENTRANT -I/usr/include/gtk-2.0 `pkg-config --cflags gtk+-2.0` -DHAVE_BOOLEAN -c -o record.o record.c
record.c: In function ‘VDO_CH_select_on_dialog_record’:
record.c:1307: warning: implicit declaration of function ‘bg_colorpixmap’
record.c: At top level:
ch17b.xpm:2: warning: ‘ch17b_xpm’ defined but not used
ch17a.xpm:2: warning: ‘ch17a_xpm’ defined but not used
gcc -Wall -D_REENTRANT -I/usr/include/gtk-2.0 `pkg-config --cflags gtk+-2.0` -DHAVE_BOOLEAN -c -o main.o main.c
gcc -Wall -D_REENTRANT -I/usr/include/gtk-2.0 `pkg-config --cflags gtk+-2.0` -DHAVE_BOOLEAN -c -o callback_ptzf.o callback_ptzf.c
callback_ptzf.c: In function ‘on_Create_dialog_OptionMenu_by_MouseBtn3’:
callback_ptzf.c:97: warning: unused variable ‘buttonRecEnd’
callback_ptzf.c:97: warning: unused variable ‘buttonRecStart’
callback_ptzf.c: In function ‘Dialog_OptionMenu_notebook_page_one’:
callback_ptzf.c:187: warning: unused variable ‘radiobutton4’
callback_ptzf.c:186: warning: unused variable ‘radiobutton3’
callback_ptzf.c: In function ‘Dialog_OptionMenu_notebook_page_two’:
callback_ptzf.c:300: warning: unused variable ‘vbox2’
callback_ptzf.c: At top level:
bg-3.xpm:2: warning: ‘bg_3_xpm’ defined but not used
ch01b.xpm:2: warning: ‘ch01b_xpm’ defined but not used
ch01a.xpm:2: warning: ‘ch01a_xpm’ defined but not used
ch02b.xpm:2: warning: ‘ch02b_xpm’ defined but not used
ch02a.xpm:2: warning: ‘ch02a_xpm’ defined but not used
ch03b.xpm:2: warning: ‘ch03b_xpm’ defined but not used
ch03a.xpm:2: warning: ‘ch03a_xpm’ defined but not used
ch04b.xpm:2: warning: ‘ch04b_xpm’ defined but not used
ch04a.xpm:2: warning: ‘ch04a_xpm’ defined but not used
ch05b.xpm:2: warning: ‘ch05b_xpm’ defined but not used
ch05a.xpm:2: warning: ‘ch05a_xpm’ defined but not used
ch06b.xpm:2: warning: ‘ch06b_xpm’ defined but not used
ch06a.xpm:2: warning: ‘ch06a_xpm’ defined but not used
ch07b.xpm:2: warning: ‘ch07b_xpm’ defined but not used
ch07a.xpm:2: warning: ‘ch07a_xpm’ defined but not used
ch08b.xpm:2: warning: ‘ch08b_xpm’ defined but not used
ch08a.xpm:2: warning: ‘ch08a_xpm’ defined but not used
ch09b.xpm:2: warning: ‘ch09b_xpm’ defined but not used
ch09a.xpm:2: warning: ‘ch09a_xpm’ defined but not used
ch10b.xpm:2: warning: ‘ch10b_xpm’ defined but not used
ch10a.xpm:2: warning: ‘ch10a_xpm’ defined but not used
ch11b.xpm:2: warning: ‘ch11b_xpm’ defined but not used
ch11a.xpm:2: warning: ‘ch11a_xpm’ defined but not used
ch12b.xpm:2: warning: ‘ch12b_xpm’ defined but not used
ch12a.xpm:2: warning: ‘ch12a_xpm’ defined but not used
ch13b.xpm:2: warning: ‘ch13b_xpm’ defined but not used
ch13a.xpm:2: warning: ‘ch13a_xpm’ defined but not used
ch14b.xpm:2: warning: ‘ch14b_xpm’ defined but not used
ch14a.xpm:2: warning: ‘ch14a_xpm’ defined but not used
ch15b.xpm:2: warning: ‘ch15b_xpm’ defined but not used
ch15a.xpm:2: warning: ‘ch15a_xpm’ defined but not used
ch16b.xpm:2: warning: ‘ch16b_xpm’ defined but not used
ch16a.xpm:2: warning: ‘ch16a_xpm’ defined but not used
ch17b.xpm:2: warning: ‘ch17b_xpm’ defined but not used
ch17a.xpm:2: warning: ‘ch17a_xpm’ defined but not used
ar -rsv libgui.a interface.o callback.o record.o main.o callback_ptzf.o
r - interface.o
r - callback.o
r - record.o
r - main.o
r - callback_ptzf.o
mv libgui.a ../../../lib/
mv: cannot move `libgui.a' to `../../../lib/': 디렉토리가 아닙니다
make: *** [libgui.a] 오류 1

-----------
이런식으로 뜨는데욤....
전에 교수님께서 make만 치는게 아니라 무슨 옵션이 있다고 하시면서
가르쳐주셨는데...
....
까먹었습니다...ㄷㄷㄷㄷ;;
현재 교수님은 출장가셨고..
설사 안가셨다고 해도 전 못물어봅니다...
가뜩이나 요즘 연구실에서 한게 없다고 엄청 혼내는데...ㄷㄷ;
make로는 안되고 makefile안에 무언가가 해결책이 있다고 하신것까지 기억나고 실제로 그렇게 하니 저런 오류는 안뜨고 warning만 뜬채 컴파일이 됬었는데......
고수님들 꼭 답변해주세요.. ㅠㅠ

fox9의 이미지

warning이 많기는 하지만 에러는 마지막에 libgui.a 파일의 mv가 안되어서 난 것 같은데요
make를 실행시킨 위치를 기준으로 ../../../lib 디렉토리가 존재하는지 살펴보시면 될 것 같습니다.
아니면 WDIR 을 수정시켜 주시면 될 것 같습니다.

ytkim4558의 이미지

요즘 파폭이 지멋대로 꺼져서 대략 돌아버리겠습니다..-_-;; (대략 15분간 답변 작성했는데 지멋대로 꺼져버리는 센스 !!)
wdir을 수정하지 않고도 컴파일이 됬었습니다
즉 make인가 gcc 인가 저 mv명령어가 들어가지 않게끔해서 컴파일한듯합니다.
한마디로 make인지 gcc인지 옵션이 저 makefile안에 있었는데 도저히 기억이 안나고 못찾겠어서 질문드리는겁니다.
답변 주신것에 대해선 깊은 감사드립니다(__)
-------------------
여기서부터는 서명입니다:-)
---------------------
운명이란 누가 주어주는것도 아니고
본인의 피로 그걸 극복할 수 있다
그 운명을 좀더 공평하게 만들고자 하는게 내 일이다.

-------------------
여기서부터는 서명입니다:-)
---------------------
운명이란 누가 주어주는것도 아니고
본인의 피로 그걸 극복할 수 있다
그 운명을 좀더 공평하게 만들고자 하는게 내 일이다.

kgykingdom의 이미지

컴파일 에러가 떠서 그러신 거라면 위에 분 말씀처럼 디렉토리만 변경하시면 될거 같은데..

질문에 요지가 좀 부족 한 듯 합니다.

waring 이 안뜨게 하고 싶다던지. 아니면 makefile 에서 에러를 안나게 하고 싶다던지.. ....

ytkim4558의 이미지

질문의 요지가 부족한거로군요 흠흠.. (솔직히 쓰면서 어케 써야할지 참으로 막막한 중생입니다..;;)
warning은 교수님에게 다녀오고나서도 나긴했었습니다만 그래도 컴파일이 되었습니다
그리고 원하는 것은
저기 makefile안에 있는 내용중 어떤것을 옵션으로
make나 gcc로 (make 어쩌고 저쩌고 하면서 옵션단거 같은데 gcc였는지도 모르겠습니다.. 답답 ㅠㅠ)
컴파일하면 warning은 위와 비슷하게 뜨지만 오류 안뜨고 바로 실행파일이 생겼습니다.
가령 make 어쩌고 저쩌고 (어쩌고 저쩌고는 makefile안에 있는 내용)
또는 gcc 어쩌고 저쩌고 ( 위와 동일;)
다만 어렴풋하게나마 make였던듯합니다
덧붙여서 교수님이 하던말 : 이런 시시한걸로 내게 와서 질문하지마! 지금까지 뭐했어! [...이랬는데 다시 물어보면 그땐 대략..]
-------------------
여기서부터는 서명입니다:-)
---------------------
운명이란 누가 주어주는것도 아니고
본인의 피로 그걸 극복할 수 있다
그 운명을 좀더 공평하게 만들고자 하는게 내 일이다.

-------------------
여기서부터는 서명입니다:-)
---------------------
운명이란 누가 주어주는것도 아니고
본인의 피로 그걸 극복할 수 있다
그 운명을 좀더 공평하게 만들고자 하는게 내 일이다.

krisna의 이미지

make testprog

를 말씀하시는 것 같군요.

에러는 무시하셔도 될것 같습니다. 출력 메시지에 따르면 libgui.a는 빌드 되었습니다.

그러나 질문에 무엇을 생성해야 하는지 그게 빠졌습니다. 구체적으로 무엇을 하려고 하는 것이고 무엇이 생성되어야 한다고 질문하시는 것이 좋겠습니다.
단지 에러안나게 하고 싶다고 하면 윗 분들 답변이 적절합니다.

ytkim4558의 이미지

testprog 때문에 그런것입니다..
아아.. 드디어 되는군요 [캐감격]
실행파일이 생성되지 않아서 그런거였습니다.
다른분들도 매우 감사드립니다~
-------------------
여기서부터는 서명입니다:-)
---------------------
운명이란 누가 주어주는것도 아니고
본인의 피로 그걸 극복할 수 있다
그 운명을 좀더 공평하게 만들고자 하는게 내 일이다.

-------------------
여기서부터는 서명입니다:-)
---------------------
운명이란 누가 주어주는것도 아니고
본인의 피로 그걸 극복할 수 있다
그 운명을 좀더 공평하게 만들고자 하는게 내 일이다.

kgykingdom의 이미지

아무래도 말씀하시는게 이거 인거 같습니다만.

### ************************************************************************
all : libgui.a clean
### ************************************************************************
libgui.a : ${OBJS}
ar -rsv $@ $?
mv $@ ${WDIR}/lib/
 
testprog: $(OBJS)
${CC} ${CFLAGS} -o $@ $? $(LFLAGS) ${LIBS}
 
### ------------------------------------------------------------------------
clean:
rm -f a.out core *.o $(OBJS)
### ************************************************************************

여기서 보시면 레이블이 4개 있는데 all, libgui.a, testprog, clean

이중에서 컴파일 하길 원하시는 것을 $ make 레이블이름 하시면 될 것 같습니다.

라이브러리 파일을 원하시면 make libgui.a 하시면 되고, 라이브러리를 수행할 테스트 프로그램을 컴파일 하시려면 make testprog 하시면

되겠네요. 지우실때는 clean, all 은 그냥 make 하면 자동 실행이니..

그리고 하나 더 있군요. usage 보니

### USAGE: ###
### To run a makefile: make -f libvdo.mk ###
### To clean: make -f libvdo.mk clean ###

이런 것도 있네요. makefile 을 따로 만드신 것도 있는 것 같습니다.

ytkim4558의 이미지

윗분의 설명으로 일단 해결했지만
레이블이 4개라는 뜻이군요 저건.. (makefile을 공부못한 저의 부족함이겠지요 GG;;)
덕부에 공부가 되었습니다(꾸벅) (__)
앞으로 공부에 좀더 정진하겠습니다!
-------------------
여기서부터는 서명입니다:-)
---------------------
운명이란 누가 주어주는것도 아니고
본인의 피로 그걸 극복할 수 있다
그 운명을 좀더 공평하게 만들고자 하는게 내 일이다.

-------------------
여기서부터는 서명입니다:-)
---------------------
운명이란 누가 주어주는것도 아니고
본인의 피로 그걸 극복할 수 있다
그 운명을 좀더 공평하게 만들고자 하는게 내 일이다.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.