【发布时间】:2020-12-13 01:55:35
【问题描述】:
我希望将 automake 用于具有很多子目录的项目。我想要实现的是将所有子目录中的所有源代码编译成一个Linux上的可执行文件。
现在我正在使用子目录对象,我必须手动指定整个层次结构的每个源代码文件的路径。
我曾尝试对每个子目录使用 LTLIBRARIES 方法,使用 Makefile.am,但由于某种原因,程序无法编译并给我很多未定义的引用错误。
现在我的 Makefile.am 文件如下所示:
AUTOMAKE_OPTIONS = subdir-objects
bin_PROGRAMS = a.out
a_out_SOURCES = EntryPoint.cpp ./glad/src/glad.cpp ./ImageLoader/ImageLoader.cpp ./FileIO/FileIO.cpp ./Debug/DebugLog.cpp ./Object/Object.cpp \
./Texture/Texture.cpp ./Window/Window.cpp ./Shader/Shader.cpp
include_HEADERS = ./glad/include/glad/glad.h ./ImageLoader/stb_image.h ./FileIO/FileIO.h ./Debug/DebugLog.h ./Object/Object.h \
./Texture/Texture.h ./Window/Window.h ./Shader/Shader.h
a_out_LDADD = -lGLEW -lGL -lsfml-graphics -lsfml-window -lsfml-system -ldl -lglfw -lm
有没有更好的方法来做到这一点?
【问题讨论】: