![]() |
#1 |
Angband Devteam member
|
Angband build system
Hi all
I have some gripes about the build system: 1. make clean commands should be idempotent - they should have the same result every time. This is true for make clean (which undoes make) but not for make distclean (which undoes configure) or make repoclean (which undoes autogen). In both those cases mk/buildsys.mk and mk/extra.mk are deleted, which then breaks the build system - you cannot run any make commands until you re-run configure to re-create them. I do not understand why the creation of these two .mk files is done by configure, but I suggest that they are not deleted by distclean (even though that then will not strictly undo configure). This way you can still make repoclean after make distclean without things being broken. Even this would leave make repoclean not idempotent (you could only run it once), but it's an improvement. 2. make clean commands should remove ALL .o and .dep files. Currently they only remove the .o and .dep files generated by the current configuration. So if you configure without --enable-sdl2, make [repo/dist]clean does not remove main-sdl2.o or main-sdl2.dep. This is infuriating. Can anyone think of a good reason not to change this? Rant over. CC
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila |
![]() |
![]() |
![]() |
#2 |
Vanilla maintainer
Join Date: Apr 2007
Location: Canberra, Australia
Age: 58
Posts: 9,528
Donated: $60
![]() ![]() |
This sounds reasonable to me - anyone else have opinions?
__________________
One for the Dark Lord on his dark throne In the Land of Mordor where the Shadows lie. |
![]() |
![]() |
![]() |
#3 |
Swordsman
Join Date: Aug 2019
Posts: 412
![]() |
As for "make distclean" not being idempotent, a more typical autoconf build system which also implements distclean as removing anything that configure generated will have the same problem as Angband's current build system. The difference will be in the error messages. distclean with autoconf would remove all the Makefiles (since each was generated from a Makefile.in by configure) so then when one tries to run "make distclean" again the result is something like
Code:
make: *** No rule to make target 'distclean'. Stop. Code:
Makefile:2: mk/buildsys.mk: No such file or directory make: *** No rule to make target `mk/buildsys.mk'. Stop. My bias would be to keep "make distclean" as it is because I want something that restores the directories to what they would be if autogen.sh has been run but configure has not. Since autogen.sh is a separate script, having another script (autoclean.sh?) to undo what autogen.sh did (or an option to autogen.sh that would cause it to undo its normal actions) and remove the repoclean target from the Makefiles seems like a reasonable alternative if one wants something that acts like "make repoclean" but won't be broken by "make distclean". As for "make clean" removing all the object files, that's very reasonable. |
![]() |
![]() |
![]() |
#4 |
Angband Devteam member
|
That's a fair point on distclean - happy to leave it as it is. I'm ok with repoclean, since it feels like a hassle to create a separate script to do it. So it means that both distclean and repoclean are one-shot powers, and you need to choose the right one!
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila |
![]() |
![]() |
![]() |
#5 |
Swordsman
Join Date: Aug 2019
Posts: 412
![]() |
Well "make repoclean" is also dangerous for those working from a .tar.gz generated by "make dist": it'll remove the configure script and such a .tar.gz does not include autogen.sh to conveniently rebuild it. That'd be another argument to folding that power into something else (as an option in autogen.sh seems better than a separate script as I've thought about it some more).
|
![]() |
![]() |
![]() |
#6 |
Angband Devteam member
|
Ah - make dist is now what creates the tarball is it? So it's replaced the old scripts/pkg_src. Good to know! For Debian I have to remove the non-free sound files and Shockbolt tiles, so I have a custom script to do that. But yes, your point about repoclean is well made, I'd be happy to see it change to a function of autogen.
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila |
![]() |
![]() |
![]() |
#7 | |
Swordsman
Join Date: Aug 2019
Posts: 412
![]() |
Quote:
As used by the release workflow on GitHub, "make dist" looks like this where archive_prefix is set from src/Makefile.src's NAME and the version string: Code:
make TAG="$archive_prefix" OUT="$archive_prefix".tar.gz dist |
|
![]() |
![]() |
![]() |
#8 |
Veteran
Join Date: Jun 2007
Posts: 1,393
![]() |
Seriously: Just write CMakeLists.txt files and be done with it.
It would be much less headache for maintainers and users-who-compile alike. Supporting platforms like Windows is much easier. |
![]() |
![]() |
![]() |
#9 | |
Swordsman
Join Date: Aug 2019
Posts: 412
![]() |
Quote:
|
|
![]() |
![]() |
![]() |
#10 |
Angband Devteam member
|
I'm not an expert on this stuff but I'm told that mixing make and cmake is not a great idea. But the good news is that I found a debian command for creating the right tarball for package building. Things are going well.
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila |
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Angband Build 4.2.4-240-g8f823a77f | normkewl | Development | 2 | March 8, 2023 17:09 |
Mk build system? | CJNyfalt | Development | 11 | March 25, 2015 07:25 |
Latest Angband Nighty build | Malak Darkhunter | Vanilla | 10 | September 14, 2011 17:44 |
This sounds more like Morgoth's build system than Sauron's. | zaimoni | Idle chatter | 1 | May 8, 2010 05:45 |
Bugs in angband-r1341 (nightly build) | Mondkalb | Vanilla | 1 | April 12, 2009 15:10 |