0

From the description of https://stackoverflow.com/a/2531841/5983841 and https://stackoverflow.com/a/26832773/5983841 , my understanding is that Makefile.am is not needed in the dist tarball.

I tried

wget https://dist.libuv.org/dist/v1.44.2/libuv-v1.44.2-dist.tar.gz
tar xf libuv-v1.44.2-dist.tar.gz
cd libuv-1.44.2/
mv Makefile.am Makefile.am.bak
./configure
make

it gives error when running make:

tian@tian-B250M-Wind:~/Desktop/playground/garage/libuv-1.44.2$ make
make: *** No rule to make target 'Makefile.am', needed by 'Makefile.in'.  Stop.
Rick
  • 7,007
  • 2
  • 49
  • 79

1 Answers1

2

I answered there: autotools are intended to be used with free software. A dist tarball for a free software project should include all the files needed for someone to be able to make changes to the project and rebuild it, as they want to: that's the foundational goal of Free Software.

They can't do that if you omit critical build files, like Makefile.am. If they wanted to add a new file or something to the project, they need the Makefile.am to modify it. So it should be included in the dist tarball.

Saying that the file is not required in order to build the software as-is without modification, is not the same thing as saying that it can be omitted.

In this specific case, automake-generated makefiles contain rules to check whether someone modified the Makefile.am file and if so, the rules will re-run automake to ensure everything is up to date and correct so you don't have to remember to do it by hand. However this of course requires that the Makefile.am file be present so make can determine that it's up to date.

MadScientist
  • 92,819
  • 9
  • 109
  • 136
  • Put another way, an autotools dist tarball is not intended to be the _minimum_ content possible to build the software. It's intended to be _everything needed_ to build, modify, and redistribute the software as Free Software. – MadScientist Nov 26 '22 at 14:34
  • Thanks a lot. Now I understand better. The last paragraph explains why my `make` fails. I tried another program source to build and also `rm Makefile.am` and it fails when running `./configure`. Same reason I guess. – Rick Nov 26 '22 at 14:46
  • Sorry to bother. Are there any conventions on which files should be included in the dist tarball, compared to the github source? https://pastebin.com/H97XATf0 . For this libuv specific case, shouldn't the dist tarball also include the `autogen.sh` file in the github source code? – Rick Nov 26 '22 at 14:55
  • I don't know of a definitive list but there may be one in some of the autotools docs. You could add `autogen.sh` if you wanted to but it's not strictly required: since you have already run it once, you don't need it anymore since the makefile you have will automatically rerun the various tools when needed (this is exactly the reason you got the error that you see when you delete `Makefile.am`). `autogen.sh` is needed to bootstrap things _before_ you have a makefile etc. that will do the rebuilds for you. – MadScientist Nov 26 '22 at 15:43