|
Packit Service |
fdd496 |
# Having a separate GNUmakefile lets me 'include' the dynamically
|
|
Packit Service |
fdd496 |
# generated rules created via cfg.mk (package-local configuration)
|
|
Packit Service |
fdd496 |
# as well as maint.mk (generic maintainer rules).
|
|
Packit Service |
fdd496 |
# This makefile is used only if you run GNU Make.
|
|
Packit Service |
fdd496 |
# It is necessary if you want to build targets usually of interest
|
|
Packit Service |
fdd496 |
# only to the maintainer.
|
|
Packit Service |
fdd496 |
|
|
Packit Service |
fdd496 |
# Copyright (C) 2001, 2003, 2006-2017 Free Software Foundation, Inc.
|
|
Packit Service |
fdd496 |
|
|
Packit Service |
fdd496 |
# This program is free software: you can redistribute it and/or modify
|
|
Packit Service |
fdd496 |
# it under the terms of the GNU General Public License as published by
|
|
Packit Service |
fdd496 |
# the Free Software Foundation, either version 3 of the License, or
|
|
Packit Service |
fdd496 |
# (at your option) any later version.
|
|
Packit Service |
fdd496 |
|
|
Packit Service |
fdd496 |
# This program is distributed in the hope that it will be useful,
|
|
Packit Service |
fdd496 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
fdd496 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit Service |
fdd496 |
# GNU General Public License for more details.
|
|
Packit Service |
fdd496 |
|
|
Packit Service |
fdd496 |
# You should have received a copy of the GNU General Public License
|
|
Packit Service |
fdd496 |
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
Packit Service |
fdd496 |
|
|
Packit Service |
fdd496 |
# If the user runs GNU make but has not yet run ./configure,
|
|
Packit Service |
fdd496 |
# give them a diagnostic.
|
|
Packit Service |
fdd496 |
_gl-Makefile := $(wildcard [M]akefile)
|
|
Packit Service |
fdd496 |
ifneq ($(_gl-Makefile),)
|
|
Packit Service |
fdd496 |
|
|
Packit Service |
fdd496 |
# Make tar archive easier to reproduce.
|
|
Packit Service |
fdd496 |
export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
|
|
Packit Service |
fdd496 |
|
|
Packit Service |
fdd496 |
# Allow the user to add to this in the Makefile.
|
|
Packit Service |
fdd496 |
ALL_RECURSIVE_TARGETS =
|
|
Packit Service |
fdd496 |
|
|
Packit Service |
fdd496 |
include Makefile
|
|
Packit Service |
fdd496 |
|
|
Packit Service |
fdd496 |
# Some projects override e.g., _autoreconf here.
|
|
Packit Service |
fdd496 |
-include $(srcdir)/cfg.mk
|
|
Packit Service |
fdd496 |
|
|
Packit Service |
fdd496 |
# Allow cfg.mk to override these.
|
|
Packit Service |
fdd496 |
_build-aux ?= build-aux
|
|
Packit Service |
fdd496 |
_autoreconf ?= autoreconf -v
|
|
Packit Service |
fdd496 |
|
|
Packit Service |
fdd496 |
include $(srcdir)/maint.mk
|
|
Packit Service |
fdd496 |
|
|
Packit Service |
fdd496 |
# Ensure that $(VERSION) is up to date for dist-related targets, but not
|
|
Packit Service |
fdd496 |
# for others: rerunning autoreconf and recompiling everything isn't cheap.
|
|
Packit Service |
fdd496 |
_have-git-version-gen := \
|
|
Packit Service |
fdd496 |
$(shell test -f $(srcdir)/$(_build-aux)/git-version-gen && echo yes)
|
|
Packit Service |
fdd496 |
ifeq ($(_have-git-version-gen)0,yes$(MAKELEVEL))
|
|
Packit Service |
fdd496 |
_is-dist-target ?= $(filter-out %clean, \
|
|
Packit Service |
fdd496 |
$(filter maintainer-% dist% alpha beta stable,$(MAKECMDGOALS)))
|
|
Packit Service |
fdd496 |
_is-install-target ?= $(filter-out %check, $(filter install%,$(MAKECMDGOALS)))
|
|
Packit Service |
fdd496 |
ifneq (,$(_is-dist-target)$(_is-install-target))
|
|
Packit Service |
fdd496 |
_curr-ver := $(shell cd $(srcdir) \
|
|
Packit Service |
fdd496 |
&& $(_build-aux)/git-version-gen \
|
|
Packit Service |
fdd496 |
.tarball-version \
|
|
Packit Service |
fdd496 |
$(git-version-gen-tag-sed-script))
|
|
Packit Service |
fdd496 |
ifneq ($(_curr-ver),$(VERSION))
|
|
Packit Service |
fdd496 |
ifeq ($(_curr-ver),UNKNOWN)
|
|
Packit Service |
fdd496 |
$(info WARNING: unable to verify if $(VERSION) is the correct version)
|
|
Packit Service |
fdd496 |
else
|
|
Packit Service |
fdd496 |
ifneq (,$(_is-install-target))
|
|
Packit Service |
fdd496 |
# GNU Coding Standards state that 'make install' should not cause
|
|
Packit Service |
fdd496 |
# recompilation after 'make all'. But as long as changing the version
|
|
Packit Service |
fdd496 |
# string alters config.h, the cost of having 'make all' always have an
|
|
Packit Service |
fdd496 |
# up-to-date version is prohibitive. So, as a compromise, we merely
|
|
Packit Service |
fdd496 |
# warn when installing a version string that is out of date; the user
|
|
Packit Service |
fdd496 |
# should run 'autoreconf' (or something like 'make distcheck') to
|
|
Packit Service |
fdd496 |
# fix the version, 'make all' to propagate it, then 'make install'.
|
|
Packit Service |
fdd496 |
$(info WARNING: version string $(VERSION) is out of date;)
|
|
Packit Service |
fdd496 |
$(info run '$(MAKE) _version' to fix it)
|
|
Packit Service |
fdd496 |
else
|
|
Packit Service |
fdd496 |
$(info INFO: running autoreconf for new version string: $(_curr-ver))
|
|
Packit Service |
fdd496 |
GNUmakefile: _version
|
|
Packit Service |
fdd496 |
touch GNUmakefile
|
|
Packit Service |
fdd496 |
endif
|
|
Packit Service |
fdd496 |
endif
|
|
Packit Service |
fdd496 |
endif
|
|
Packit Service |
fdd496 |
endif
|
|
Packit Service |
fdd496 |
endif
|
|
Packit Service |
fdd496 |
|
|
Packit Service |
fdd496 |
.PHONY: _version
|
|
Packit Service |
fdd496 |
_version:
|
|
Packit Service |
fdd496 |
cd $(srcdir) && rm -rf autom4te.cache .version && $(_autoreconf)
|
|
Packit Service |
fdd496 |
$(MAKE) $(AM_MAKEFLAGS) Makefile
|
|
Packit Service |
fdd496 |
|
|
Packit Service |
fdd496 |
else
|
|
Packit Service |
fdd496 |
|
|
Packit Service |
fdd496 |
.DEFAULT_GOAL := abort-due-to-no-makefile
|
|
Packit Service |
fdd496 |
srcdir = .
|
|
Packit Service |
fdd496 |
|
|
Packit Service |
fdd496 |
# The package can override .DEFAULT_GOAL to run actions like autoreconf.
|
|
Packit Service |
fdd496 |
-include ./cfg.mk
|
|
Packit Service |
fdd496 |
|
|
Packit Service |
fdd496 |
# Allow cfg.mk to override these.
|
|
Packit Service |
fdd496 |
_build-aux ?= build-aux
|
|
Packit Service |
fdd496 |
_autoreconf ?= autoreconf -v
|
|
Packit Service |
fdd496 |
|
|
Packit Service |
fdd496 |
include ./maint.mk
|
|
Packit Service |
fdd496 |
|
|
Packit Service |
fdd496 |
ifeq ($(.DEFAULT_GOAL),abort-due-to-no-makefile)
|
|
Packit Service |
fdd496 |
$(MAKECMDGOALS): abort-due-to-no-makefile
|
|
Packit Service |
fdd496 |
endif
|
|
Packit Service |
fdd496 |
|
|
Packit Service |
fdd496 |
abort-due-to-no-makefile:
|
|
Packit Service |
fdd496 |
@echo There seems to be no Makefile in this directory. 1>&2
|
|
Packit Service |
fdd496 |
@echo "You must run ./configure before running 'make'." 1>&2
|
|
Packit Service |
fdd496 |
@exit 1
|
|
Packit Service |
fdd496 |
|
|
Packit Service |
fdd496 |
endif
|
|
Packit Service |
fdd496 |
|
|
Packit Service |
fdd496 |
# Tell version 3.79 and up of GNU make to not build goals in this
|
|
Packit Service |
fdd496 |
# directory in parallel, in case someone tries to build multiple
|
|
Packit Service |
fdd496 |
# targets, and one of them can cause a recursive target to be invoked.
|
|
Packit Service |
fdd496 |
|
|
Packit Service |
fdd496 |
# Only set this if Automake doesn't provide it.
|
|
Packit Service |
fdd496 |
AM_RECURSIVE_TARGETS ?= $(RECURSIVE_TARGETS:-recursive=) \
|
|
Packit Service |
fdd496 |
$(RECURSIVE_CLEAN_TARGETS:-recursive=) \
|
|
Packit Service |
fdd496 |
dist distcheck tags ctags
|
|
Packit Service |
fdd496 |
|
|
Packit Service |
fdd496 |
ALL_RECURSIVE_TARGETS += $(AM_RECURSIVE_TARGETS)
|
|
Packit Service |
fdd496 |
|
|
Packit Service |
fdd496 |
ifneq ($(word 2, $(MAKECMDGOALS)), )
|
|
Packit Service |
fdd496 |
ifneq ($(filter $(ALL_RECURSIVE_TARGETS), $(MAKECMDGOALS)), )
|
|
Packit Service |
fdd496 |
.NOTPARALLEL:
|
|
Packit Service |
fdd496 |
endif
|
|
Packit Service |
fdd496 |
endif
|