-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpkg-config.mk
79 lines (69 loc) · 2.59 KB
/
pkg-config.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# -*-Automake-*-
# Copyright (C) 2009 by Thomas Moulard, AIST, CNRS, INRIA.
# This file is part of the roboptim.
#
# roboptim is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Additional permission under section 7 of the GNU General Public
# License, version 3 ("GPLv3"):
#
# If you convey this file as part of a work that contains a
# configuration script generated by Autoconf, you may do so under
# terms of your choice.
#
# roboptim is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with roboptim. If not, see <http://www.gnu.org/licenses/>.
# -------#
# README #
# -------#
# This file contains pkg-config generation rules for Automake.
#
# This file assumes that:
#
# - you include *before* this file init.mk or make sure that any global
# variable can be used with the += syntax.
# - there is no other rule using install-data-local and uninstall-data-local.
#
# The generate pkg-config files can be customized using three Autoconf
# variables:
# - PKGCONFIG_REQUIRES: package dependencies,
# - PKGCONFIG_LIBS: package LDFLAGS,
# - PKGCONFIG_CFLAGS: package CFLAGS/CPPFLAGS/CXXFLAGS.
# Variables
pkg_config_file = '@PACKAGE_TARNAME@.pc'
pkgdir = "$(DESTDIR)$(libdir)/pkgconfig/"
EXTRA_DIST += build-aux/pkg-config.pc.in
CLEANFILES += $(pkg_config_file)
# pkg-config generation.
# One has to make sure the ``.pc'' file is regenerated if:
# - the package version
# - or the compilation flags
# are changed.
@PACKAGE_TARNAME@.pc: $(srcdir)/build-aux/pkg-config.pc.in \
$(top_builddir)/config.status
$(top_builddir)/config.status \
--file="$@":"$(srcdir)/build-aux/pkg-config.pc.in"
# Install, uninstall rules.
install-data-local: install-pkg-config
uninstall-local: uninstall-pkg-config
install-pkg-config: $(PACKAGE_TARNAME).pc
$(mkdir_p) $(pkgdir)
$(install_sh_DATA) $(pkg_config_file) $(pkgdir)
uninstall-pkg-config:
-rm -f "$(pkgdir)$(pkg_config_file)"
# Check that the pkg-config file is generated.
check-local: @PACKAGE_TARNAME@.pc
@if ! test -f $(pkg_config_file); then \
echo 'pkg-config file missing: failing...'; \
return 1; \
else \
echo 'pkg-config file has been generated: ok.'; \
fi