Simon Sobisch
Simon Sobisch

Reputation: 7288

How to exclude specific directories for dist-gzip / dist-zip?

Background: Automake provides different types of distributions. After reading the docs "What Goes in a Distribution" I know how to include extra directories in general. But I'm not sure about the best way to exclude directories in this list for a single rule.

This is the part in current configure.ac that adds to the dist directories

AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build_aux])

And this is the part in current Makefile.am that adds to the dist directories

SUBDIRS = sources po doc tests
EXTRA_DIST = build_windows

Furthermore Makefile.am has

AUTOMAKE_OPTIONS = dist-zip

For enabling the zip distribution.

Result: both package.tar.gz and package.zip have the same content. Therefore the following directories are included:

Question: How to exclude build_windows in package.tar.gz and m4 in package.zip?

Upvotes: 0

Views: 615

Answers (2)

Simon Sobisch
Simon Sobisch

Reputation: 7288

Long answer:

Different types of distributions only mean different format, but the content of these is designed to be exactly the same.

Therefore the solution for the goal is:

  • remove build_windows from EXTRA_DIST for having only needed content in the tar.gz distribution
  • remove dist-zip from AUTOMAKE_OPTIONS to prevent auto-generation of package.zip
  • add (or in this case edit) the dist-hook rule to manually:
    • check if build_windows exist (it won't exist if build from package.tar.gz)
    • copy the dist-content to a temporary directory
    • remove/add files/folders there as needed
    • create a package_win.zip from this folder (use a different name for preventing a possible package.zip to overwrite the file)

Edit: removing anything from the manually created dist folder will break make dist (or at least make distcheck), therefore this is only a good idea if you want to remove everything that has to do with autoconf/automake/Makfiles in general

Upvotes: 1

Diego Elio Pettenò
Diego Elio Pettenò

Reputation: 3240

The short version is you don't. Different types of distributions only mean different format, but the content of these is designed to be exactly the same.

Upvotes: 1

Related Questions