Arne Böckmann
Arne Böckmann

Reputation: 487

Automatically run 'make check' if 'make install' is executed in autotools

Is it possible to execute 'make check' prior to 'make install' and abort the install if check failed?

The behavior should be like this:

  1. User runs 'make install'
  2. 'make check' is run.
  3. If check failed install is not executed. Otherwise install is executed.

edit:

I got it working by overriding the install rule in the top level Makefile.am like this:

install: check install-recursive

But I would rather have a solution that does not override the install target.

Upvotes: 2

Views: 378

Answers (1)

ptomato
ptomato

Reputation: 57854

You can hook into the install process using the install-exec-local or install-data-local targets:

install-exec-local: check

Upvotes: 3

Related Questions