xref: /pciutils/lib/Makefile (revision 752d4d9a)
1727ce158SMartin Mares# Makefile for The PCI Library
2*752d4d9aSMartin Mares# (c) 1999--2008 Martin Mares <[email protected]>
3727ce158SMartin Mares
4727ce158SMartin Maresinclude config.mk
5727ce158SMartin Mares
6*752d4d9aSMartin MaresOBJS=access.o generic.o dump.o names.o filter.o names-hash.o names-parse.o
7489233b4SMartin MaresINCL=internal.h pci.h config.h header.h sysdep.h types.h
8727ce158SMartin Mares
9848b4347SMartin MaresPCILIB=libpci.a
105670e427SMartin MaresPCILIBPC=libpci.pc
11848b4347SMartin Mares
12489233b4SMartin Maresifdef PCI_HAVE_PM_LINUX_SYSFS
1311f7b31bSMartin MaresOBJS += sysfs.o
1411f7b31bSMartin Maresendif
1511f7b31bSMartin Mares
16489233b4SMartin Maresifdef PCI_HAVE_PM_LINUX_PROC
17727ce158SMartin MaresOBJS += proc.o
18727ce158SMartin Maresendif
19727ce158SMartin Mares
20489233b4SMartin Maresifdef PCI_HAVE_PM_INTEL_CONF
21727ce158SMartin MaresOBJS += i386-ports.o
22727ce158SMartin Maresendif
23727ce158SMartin Mares
24489233b4SMartin Maresifdef PCI_HAVE_PM_DUMP
25727ce158SMartin MaresOBJS += dump.o
26727ce158SMartin Maresendif
27727ce158SMartin Mares
28489233b4SMartin Maresifdef PCI_HAVE_PM_FBSD_DEVICE
29168b4f46SMartin MaresOBJS += fbsd-device.o
30168b4f46SMartin MaresCFLAGS += -I/usr/src/sys
3145902995SMartin Maresifdef FREEBSD_SYS
3245902995SMartin MaresCFLAGS += -I${FREEBSD_SYS}
3345902995SMartin Maresendif
34168b4f46SMartin Maresendif
35168b4f46SMartin Mares
36b6359063SMartin Maresifdef PCI_HAVE_PM_OBSD_DEVICE
37b6359063SMartin MaresOBJS += obsd-device.o
38b6359063SMartin Maresendif
39b6359063SMartin Mares
40489233b4SMartin Maresifdef PCI_HAVE_PM_AIX_DEVICE
4114d6c0a3SMartin MaresOBJS += aix-device.o
4214d6c0a3SMartin Maresendif
4314d6c0a3SMartin Mares
44489233b4SMartin Maresifdef PCI_HAVE_PM_NBSD_LIBPCI
45848b4347SMartin MaresOBJS += nbsd-libpci.o
46848b4347SMartin MaresPCILIB=libpciutils.a
47848b4347SMartin Maresendif
48848b4347SMartin Mares
49*752d4d9aSMartin Mares# FIXME: Conditions
50*752d4d9aSMartin MaresOBJS += names-net.o names-cache.o
51*752d4d9aSMartin Mares
525670e427SMartin Maresall: $(PCILIB) $(PCILIBPC)
53727ce158SMartin Mares
54848b4347SMartin Mares$(PCILIB): $(OBJS)
55727ce158SMartin Mares	rm -f $@
56325a3c50SMartin Mares	$(AR) rcs $@ $^
57325a3c50SMartin Mares	$(RANLIB) $@
58727ce158SMartin Mares
595670e427SMartin Mares$(PCILIBPC): $(PCILIBPC).in
605670e427SMartin Mares	sed <$< >$@ -e 's,@PREFIX@,$(PREFIX),' \
615670e427SMartin Mares		-e 's,@INCDIR@,$(INCDIR),' \
625670e427SMartin Mares		-e 's,@LIBDIR@,$(LIBDIR),' \
635670e427SMartin Mares		-e 's,@IDSDIR@,$(IDSDIR),' \
645670e427SMartin Mares		-e 's,@VERSION@,$(VERSION),' \
655670e427SMartin Mares		-e 's,@LIBZ@,$(LIBZ),'
665670e427SMartin Mares
67727ce158SMartin Maresaccess.o: access.c $(INCL)
68fc1ec2acSMartin Maresi386-ports.o: i386-ports.c $(INCL) i386-io-hurd.h i386-io-linux.h i386-io-sunos.h i386-io-windows.h
6911f7b31bSMartin Maresproc.o: proc.c $(INCL) pread.h
7011f7b31bSMartin Maressysfs.o: sysfs.c $(INCL) pread.h
71727ce158SMartin Maresgeneric.o: generic.c $(INCL)
72727ce158SMartin Maressyscalls.o: syscalls.c $(INCL)
7338a9e3c3SMartin Maresobsd-device.o: obsd-device.c $(INCL)
74168b4f46SMartin Maresfbsd-device.o: fbsd-device.c $(INCL)
7514d6c0a3SMartin Maresaix-device.o: aix-device.c $(INCL)
76727ce158SMartin Maresdump.o: dump.c $(INCL)
77*752d4d9aSMartin Maresnames.o: names.c $(INCL) names.h
78*752d4d9aSMartin Maresnames-cache.o: names-cache.c $(INCL) names.h
79*752d4d9aSMartin Maresnames-hash.o: names-hash.c $(INCL) names.h
80*752d4d9aSMartin Maresnames-net.o: names-net.c $(INCL) names.h
81*752d4d9aSMartin Maresnames-parse.o: names-parse.c $(INCL) names.h
82727ce158SMartin Maresfilter.o: filter.c $(INCL)
83848b4347SMartin Maresnbsd-libpci.o: nbsd-libpci.c $(INCL)
8414d4f989SMartin Mares
8514d4f989SMartin Maresexample: example.c $(PCILIB)
86