我使用在线教程制作了测试makefile。它的工作原理,但我也想让我所有的.o文件转到特定的子文件夹。有没有办法使用makefile来做到这一点?这是我到目前为止。在MakeFile中设置选项将目标文件发送到特定文件夹
CC=gcC# specifies the compiler to use.
CFLAGS=-I. # specifies to look in the current directory.
DEPS = path_tools.h # DEPS stores each .h file to be added.
OBJ = checkpath.o path_tools.o # OBJ stores each object file to compile.
%.o: %.c $(DEPS)
$(CC) -c -o [email protected] $< $(CFLAGS)
checkpath.exe: $(OBJ)
gcc -o [email protected] $^ $(CFLAGS)
你知道你现在的makefile有什么功能吗?它是如何做到的? –