|
Need help with a basic transportable Makefile |
Mark Oates
Member #1,146
March 2001
|
Hey all, I'm looking for something that is essentially a very boilerplate Makefile that should work on "most if not all" systems. The Makefile should expect an "include" and "source" directory, and some program files at the base `.`. The source and include folders will have nested folders, but will not have any files with main()s or entry points. The entry points will only exist for the program files at the base. Would look something like this: include/ NestedA/ NestedA2/ ComponentFileA.hpp ComponentFileB.hpp src/ NestedA/ NestedA2/ ComponentFileA.cpp ComponentFileB.cpp ProgramFileX.cpp ProgramFileY.cpp It doesn't need to be efficient or flexible, it should just "work" when invoking make. (It will need to include allegro and a few compiler flags like -c++17. I'm less worried about that). Is there a typical boilerplate or convention for something like this? My current build system has grown so complex I'm lost sight of what "typical" is -- |
Edgar Reynaldo
Major Reynaldo
May 2007
|
I'm gonna be blunt. Use CMake. Sorry. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Mark Oates
Member #1,146
March 2001
|
-- |
Edgar Reynaldo
Major Reynaldo
May 2007
|
The sad truth is, makefiles aren't portable unless your target consumer only uses gcc. CMake will generate them for you, and then you could tweak it yourself. I would be more than glad to teach you what I know of CMake. I've replaced Eagle's build system with CMake, and it's a breeze. No maintenance, no mess. They're really easy once you get the hang of it. I also offer a CHM manual for CMake 3.14rc4, which is fairly recent and covers everything backwards compatibly. https://bitbucket.org/bugsquasher/unofficial-allegro-5-binaries/downloads/CMake314rc4.chm My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Mark Oates
Member #1,146
March 2001
|
Thanks Edgar. There's really no need for a new build system considering the circumstances. I managed to just create a simple Makefile. Looks like this: SRC_FILES := $(shell find src -type f) ALLEGRO_LIBS=-lallegro_color -lallegro_font -lallegro_ttf -lallegro_dialog -lallegro_audio -lallegro_acodec -lallegro_primitives -lallegro_image -lallegro -lallegro_main main: $(SRC_FILES) g++ -std=c++17 $^ programs/LabyrinthOfLore.cpp -o LabyrinthOfLore -I./include $(ALLEGRO_LIBS)
-- |
RmBeer2
Member #16,660
April 2017
|
When the situation becomes so complex to make, use cmake. 🌈🌈🌈 🌟 BlackRook WebSite (Only valid from my installer) 🌟 C/C++ 🌟 GNU/Linux 🌟 IceCream/Cornet 🌟 🌈🌈🌈 Rm Beer for Emperor 2021! Rm Beer for Ruinous Slave Drained 2022! Rm Beer for Traveler From The Future Warning Not To Enter In 2023! Rm Beer are building a travel machine for Go Back from 2023! Rm Beer in an apocalyptic world burning hordes of Zombies in 2024! |
|