2012-09-10 4 views
0

소프트웨어 프로젝트를 만들고 있는데 autotools를 사용하여 makefile 등을 생성하고 싶습니다. 수동으로 Makefile.am을 만들고 구성했습니다. 파일에서, 그리고 here에서 autogen.sh 스크립트를 사용하고 있습니다. 이 문제는 프로젝트를 별도의 '빌드'디렉토리 (예. 내가 가면 :autotools 빌드 시스템/빌드를 별도의 빌드 디렉토리에 사용합니다.

mkdir build 
cd build 
../configure 
make 

구성 단계는 잘 작동하지만 실행했을 때 얻을합니다

make all-recursive 
Making all in src 
/bin/sh: line 0: cd: src: No such file or directory 
make[1]: *** [all-recursive] Error 1 
make: *** [all] Error 2 

모든 팁이 작업을 얻을? 아니면 포기해야하고 좀 더 단순한/다른 것을 시도해야합니다. 필자는 이것이 합리적으로 간단한 C++ 프로젝트가 될 계획이며, 부울 유닛 테스트 프레임 워크에만 의존하고 Eclipse IDE에서 대부분의 개발 작업을 수행 할 계획입니다. 에 버그가있어

+1

이 당신의 Makefile.am의 문제가 될 것으로 보인다. 당신이 그들을 게시 할 수 있다면 좋을 것입니다. (최소한 Makefile.am은 프로젝트의 루트와 src에 있습니다. src /가 프로젝트 루트에 있다고 가정하십시오.) –

+0

죄송합니다 .. 여기에 https : //gist.github입니다. com/3690227 –

답변

1

당신의 src/Makefile.am, 라인 # 17 :

swin-adventure_SOURCES = src/main.cc 

정말 읽어야

swin-adventure_SOURCES = main.cc 

을 SRC/src에 거기하지 않는합니다 (SRC/디렉토리에 이미 있기 때문에/하위 폴더)

_SOURCES 변수에 특수 문자를 사용하면 다른 버그가 있습니다. swin-adventure_SOURCES은 금지 된 -을 가지고 있습니다. 캐릭터; 마지막으로 swin_adventure_SOURCES

에, 당신은 bin_PROGRAMS 여러 번 (매번 같은 값)에 값을 할당하려고하는 것을 정상화 시도,이를 방지하려고합니다. 같은

뭔가 :

## Additional flags to pass to aclocal when it is invoked automatically at 
## make time. The ${ACLOCAL_FLAGS} variable is picked up from the environment 
## to provide a way for the user to supply additional arguments. 
ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} 

## Define an executable target "swin-adventure", which will be installed into the 
## directory named by the predefined variable $(bindir). 
bin_PROGRAMS = swin-adventure 

## Define the list of source files for the "swin-adventure" target. The file 
## extension .cc is recognized by Automake, and causes it to produce rules 
## which invoke the C++ compiler to produce an object file (.o) from each 
## source file. The ## header files (.h) do not result in object files by 
## themselves, but will be included in distribution archives of the project. 
swin_adventure_SOURCES = main.cc 
+0

정말 도움이되었습니다. 생성 된 바이너리가 생성 된 곳으로 이동하는 방법이 있습니까 (예 : src 디렉토리가 아닌 루트 디렉토리에 생성 하시겠습니까?) –

+0

일반적으로 다음을 수행하지 마십시오 :-) . 만약 당신이 루트 디렉토리에 있어야한다면 절대 src/Makefile.am이 아닌 루트 Makefile.am에 모든 빌드 정보를 추가 할 수 있습니다. 이번에는'src/main.cc'를 사용합니다 (이것은 우리가 들어온 곳입니까?); 또는 결과 바이너리를 원하는 장소에 복사/심볼릭 링크하는 빌드 후크를 추가합니다 –

관련 문제