OSDN Git Service

config: provide a makefile for scanpci dev tool
authorGaetan Nadon <memsize@videotron.ca>
Sun, 22 Aug 2010 12:10:23 +0000 (08:10 -0400)
committerGaetan Nadon <memsize@videotron.ca>
Sun, 3 Oct 2010 18:02:44 +0000 (14:02 -0400)
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 <remi@gentoo.org>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Makefile.am
configure.ac
scanpci/.gitignore [new file with mode: 0644]
scanpci/Makefile.am [new file with mode: 0644]
scanpci/scanpci.c [moved from src/scanpci.c with 100% similarity]
src/.gitignore [deleted file]
src/Makefile.am

index ff8db2f..31d20a0 100644 (file)
 # 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
 
index c0e1e9b..6980675 100644 (file)
@@ -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 (file)
index 0000000..485d4b9
--- /dev/null
@@ -0,0 +1 @@
+scanpci
diff --git a/scanpci/Makefile.am b/scanpci/Makefile.am
new file mode 100644 (file)
index 0000000..6fdf86e
--- /dev/null
@@ -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
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 (file)
index 5c8b286..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#              Add & Override for this directory and it's subdirectories
-scanpci
index 0ee8449..0d774e0 100644 (file)
@@ -77,7 +77,3 @@ libpciaccessincludedir = $(includedir)
 libpciaccessinclude_HEADERS = \
     $(top_srcdir)/include/pciaccess.h
 
-noinst_PROGRAMS = scanpci
-
-scanpci_SOURCES = scanpci.c
-scanpci_LDADD = libpciaccess.la