From dcb79a20cba1eaaa83158b80bb538d50b003bd79 Mon Sep 17 00:00:00 2001 From: Gaetan Nadon Date: Sun, 22 Aug 2010 08:10:23 -0400 Subject: [PATCH] config: provide a makefile for scanpci dev tool MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit No function changes. Note that automake generates a wrapper script if libpciaccess is not installed at configuration time, which is the most common case. If it is installed at configuration time, you get an executable. The makefile build order ensures the lib is build before scanpci. Reviewed-by: Rémi Cardona Signed-off-by: Gaetan Nadon --- Makefile.am | 5 +++-- configure.ac | 1 + scanpci/.gitignore | 1 + scanpci/Makefile.am | 29 +++++++++++++++++++++++++++++ {src => scanpci}/scanpci.c | 0 src/.gitignore | 2 -- src/Makefile.am | 4 ---- 7 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 scanpci/.gitignore create mode 100644 scanpci/Makefile.am rename {src => scanpci}/scanpci.c (100%) delete mode 100644 src/.gitignore diff --git a/Makefile.am b/Makefile.am index ff8db2f..31d20a0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -24,13 +24,14 @@ # Include autoconf macros from m4 subdir ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = src +# Order: scanpci depends on libpciaccess built in src +SUBDIRS = src scanpci pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = pciaccess.pc MAINTAINERCLEANFILES = ChangeLog INSTALL -EXTRA_DIST = src/scanpci.c src/scanpci.man +EXTRA_DIST = src/scanpci.man .PHONY: ChangeLog INSTALL diff --git a/configure.ac b/configure.ac index c0e1e9b..6980675 100644 --- a/configure.ac +++ b/configure.ac @@ -124,4 +124,5 @@ AC_SUBST(PCIACCESS_LIBS) AC_OUTPUT([Makefile src/Makefile + scanpci/Makefile pciaccess.pc]) diff --git a/scanpci/.gitignore b/scanpci/.gitignore new file mode 100644 index 0000000..485d4b9 --- /dev/null +++ b/scanpci/.gitignore @@ -0,0 +1 @@ +scanpci diff --git a/scanpci/Makefile.am b/scanpci/Makefile.am new file mode 100644 index 0000000..6fdf86e --- /dev/null +++ b/scanpci/Makefile.am @@ -0,0 +1,29 @@ +# +# (C) Copyright IBM Corporation 2006 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +noinst_PROGRAMS = scanpci + +AM_CPPFLAGS = -I$(top_srcdir)/include +AM_LDFLAGS = -L$(top_builddir)/src -lpciaccess + +scanpci_SOURCES = scanpci.c diff --git a/src/scanpci.c b/scanpci/scanpci.c similarity index 100% rename from src/scanpci.c rename to scanpci/scanpci.c diff --git a/src/.gitignore b/src/.gitignore deleted file mode 100644 index 5c8b286..0000000 --- a/src/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Add & Override for this directory and it's subdirectories -scanpci diff --git a/src/Makefile.am b/src/Makefile.am index 0ee8449..0d774e0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -77,7 +77,3 @@ libpciaccessincludedir = $(includedir) libpciaccessinclude_HEADERS = \ $(top_srcdir)/include/pciaccess.h -noinst_PROGRAMS = scanpci - -scanpci_SOURCES = scanpci.c -scanpci_LDADD = libpciaccess.la -- 2.7.4