저는 Makefile을 매우 새로 도입했습니다. 다음 메이크 파일을 만들었습니다. (작동하지 않습니다.) genntated 오브젝트 코드를 differnt 폴더에 넣지 않을 것입니다 (폴더는 현재 디렉토리에 있습니다).다른 폴더에 개체 코드를 넣을 메이크 파일을 만드는 방법
$ ls
main.cpp Makefile object_code Time.cpp Time_.h
어떻게하면됩니까 ??
VER = Debug
CC = g++
OBJECTFIELS = ./object_code/main.o ./object_code/Time.o
../$(VER)/main: $(OBJECTFIELS)
$(CC) $(OBJECTFIELS) -o [email protected]
$(OBJECTFIELS): Time_.h
./object_code/main.o: main.cpp
./object_code/Time.o: Time.cpp
clean:
rm $(OBJECTFIELS) main
이것은 오류입니다.
$ make
g++ ./object_code/main.o ./object_code/Time.o -o ../Debug/main
g++: error: ./object_code/main.o: No such file or directory
g++: error: ./object_code/Time.o: No such file or directory
g++: fatal error: no input files
compilation terminated.
Makefile:8: recipe for target '../Debug/main' failed
make: *** [../Debug/main] Error 1
이것이 마지막 질문입니다.