[질문] make 에러입니다.... 도와주세요

sonds7의 이미지

cygwin을 가지고 FreeRTOS 컴파일 중인데요.

make 파일 에러가 나서요.

arm-elf-gcc -c -Wall -D  -D GCC_AT91FR40008 -I.  -I../../Source/include 
-I../Common/include -mcpu=arm7tdmi -T -Wcast-align -fomit-frame-pointer -fno-strict-aliasing 
../../Source/portable/GCC/ARM7_AT91FR40008/portISR.c -o 
../../Source/portable/GCC/ARM7_AT91FR40008/portISR.o
arm-elf-gcc: cannot specify -o with -c or -S and multiple compilations
make: *** [../../Source/portable/GCC/ARM7_AT91FR40008/portISR.o] Error 1

CC=arm-elf-gcc
OBJCOPY=arm-elf-objcopy
ARCH=arm-elf-ar
CRT0=boot.s
 
#
# CFLAGS common to both the THUMB and ARM mode builds
#
CFLAGS=-Wall -D $(RUN_MODE) -D GCC_AT91FR40008 -I. -I../../Source/include \
		-I../Common/include $(DEBUG) -mcpu=arm7tdmi -T $(LDSCRIPT) \
		-Wcast-align $(OPTIM) -fomit-frame-pointer -fno-strict-aliasing
 
ifeq ($(USE_THUMB_MODE),YES)
	CFLAGS += -mthumb-interwork -D THUMB_INTERWORK
	THUMB_FLAGS=-mthumb
endif
 
 
LINKER_FLAGS=-Xlinker -o rtosdemo.elf -Xlinker -M -Xlinker -Map=rtosdemo.map
 
#
# Source files that can be built to THUMB mode.
#
THUMB_SRC = \
main.c \
serial/serial.c \
ParTest/ParTest.c \
../Common/Minimal/integer.c \
../Common/Minimal/flash.c \
../Common/Minimal/PollQ.c \
../Common/Minimal/comtest.c \
../Common/Minimal/flop.c \
../Common/Minimal/semtest.c \
../Common/Minimal/dynamic.c \
../Common/Minimal/BlockQ.c \
../../Source/tasks.c \
../../Source/queue.c \
../../Source/list.c \
../../Source/portable/MemMang/heap_2.c \
../../Source/portable/GCC/ARM7_AT91FR40008/port.c
 
#
# Source files that must be built to ARM mode.
#
ARM_SRC = \
../../Source/portable/GCC/ARM7_AT91FR40008/portISR.o \
serial/serialISR.c
 
#
# Define all object files.
#
ARM_OBJ = $(ARM_SRC:.c=.o)
THUMB_OBJ = $(THUMB_SRC:.c=.o)
 
rtosdemo.hex : rtosdemo.elf
	$(OBJCOPY) rtosdemo.elf -O ihex rtosdemo.hex
 
rtosdemo.elf : $(ARM_OBJ) $(THUMB_OBJ) $(CRT0) Makefile
	$(CC) $(CFLAGS) $(ARM_OBJ) $(THUMB_OBJ) -nostartfiles $(CRT0) $(LINKER_FLAGS)
 
$(THUMB_OBJ) : %.o : %.c $(LDSCRIPT) Makefile
	$(CC) -c $(THUMB_FLAGS) $(CFLAGS) $< -o $@
 
$(ARM_OBJ) : %.o : %.c $(LDSCRIPT) Makefile
	$(CC) -c $(CFLAGS) $< -o $@
 
clean :
	touch Makefile

검색으론 답을 찾을수 없어 이렇게 질문해 봅니다...
jachin의 이미지

Quote:
arm-elf-gcc: cannot specify -o with -c or -S and multiple compilations

-o 옵션과 -c 혹은 -S 옵션은 같이 지정할 수 없으며, 여러개의 오브젝트 파일을 한 번에 컴파일 하려고 했답니다.
위에 쓰여있는 명령어를 잘 보십시오.
arm-elf-gcc \
-c -Wall \
-D \
-D GCC_AT91FR40008 \
-I. \
-I../../Source/include \
-I../Common/include \
-mcpu=arm7tdmi \
-T \
-Wcast-align \
-fomit-frame-pointer \
-fno-strict-aliasing \
../../Source/portable/GCC/ARM7_AT91FR40008/portISR.c \
-o ../../Source/portable/GCC/ARM7_AT91FR40008/portISR.o

이해를 돕기 위해 인자별로 나누어 봤습니다. -c 와 -o 옵션이 한 명령어 행에 들어있는 것이 보이시나요?
make 내용 중, portISR.o 를 만들기 위한 규칙에서 -c 옵션이 들어있습니다만, 이 옵션을 제거해주셔야 합니다.
그럼 관련된 레이블은 무엇일까요?
$(ARM_OBJ) : %.o : %.c $(LDSCRIPT) Makefile
        $(CC) -c $(CFLAGS) $< -o $@

이 부분이 의심스럽지 않으세요? +_+
====
( - -)a 이제는 학생으로 가장한 백수가 아닌 진짜 백수가 되어야겠다.
kjh05lhj00의 이미지

-c 옵션을 빼봤는데,

:1:1: macro names must be indentifiers

이게뜨고,

밑에, 헤더파일이랑 씨파일 에 parse error가 많이뜹니다.

그럼 헤더파일이랑 씨파일을 수정해야 하는건가요?

jachin의 이미지

'환자는 항상 거짓말을 하지..' 라는 명대사가...
그렇게 얘기하셔도 뭐가 잘못 됐는지 전 모릅니다.
어떤 소스를 보고 계시는지, 어떤 컴파일 환경에 있는지, 어떤 장치를 타겟으로 하고 계시는지 말이죠.

밑에 헤더파일이랑 씨파일에 parse error 가 나는 이유는 -c 옵션으로 생성된 파일들이 없어서 그런겁니다.
그렇다고 -c 옵션 대신 -o 옵션을 빼지는 마세요.

make 전체 로그 중 -c 와 -o 를 같이 넣어서 문제가 생기는 부분은 알려주신 에러 생기는 부분 한 군데 뿐일 것입니다.
make 룰을 변경하셔야 할 때입니다.
====
( - -)a 이제는 학생으로 가장한 백수가 아닌 진짜 백수가 되어야겠다.

bushi의 이미지

ARM_SRC = \
   ../../Source/portable/GCC/ARM7_AT91FR40008/portISR.o \
   serial/serialISR.c
...
ARM_OBJ = $(ARM_SRC:.c=.o)
...

오타 ?

OTL

댓글 달기

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
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.