]> mj.ucw.cz Git - pciutils.git/blob - lib/Makefile
Unify usage of u8 vs. byte.
[pciutils.git] / lib / Makefile
1 # Makefile for The PCI Library
2 # (c) 1999--2008 Martin Mares <mj@ucw.cz>
3
4 include config.mk
5
6 OBJS=init.o access.o generic.o dump.o names.o filter.o names-hash.o names-parse.o names-net.o names-cache.o params.o
7 INCL=internal.h pci.h config.h header.h sysdep.h types.h
8
9 PCILIB=libpci.a
10 PCILIBPC=libpci.pc
11
12 ifdef PCI_HAVE_PM_LINUX_SYSFS
13 OBJS += sysfs.o
14 endif
15
16 ifdef PCI_HAVE_PM_LINUX_PROC
17 OBJS += proc.o
18 endif
19
20 ifdef PCI_HAVE_PM_INTEL_CONF
21 OBJS += i386-ports.o
22 endif
23
24 ifdef PCI_HAVE_PM_DUMP
25 OBJS += dump.o
26 endif
27
28 ifdef PCI_HAVE_PM_FBSD_DEVICE
29 OBJS += fbsd-device.o
30 CFLAGS += -I/usr/src/sys
31 ifdef FREEBSD_SYS
32 CFLAGS += -I${FREEBSD_SYS}
33 endif
34 endif
35
36 ifdef PCI_HAVE_PM_OBSD_DEVICE
37 OBJS += obsd-device.o
38 endif
39
40 ifdef PCI_HAVE_PM_AIX_DEVICE
41 OBJS += aix-device.o
42 endif
43
44 ifdef PCI_HAVE_PM_NBSD_LIBPCI
45 OBJS += nbsd-libpci.o
46 PCILIB=libpciutils.a
47 endif
48
49 all: $(PCILIB) $(PCILIBPC)
50
51 $(PCILIB): $(OBJS)
52         rm -f $@
53         $(AR) rcs $@ $^
54         $(RANLIB) $@
55
56 $(PCILIBPC): $(PCILIBPC).in
57         sed <$< >$@ -e 's,@PREFIX@,$(PREFIX),' \
58                 -e 's,@INCDIR@,$(INCDIR),' \
59                 -e 's,@LIBDIR@,$(LIBDIR),' \
60                 -e 's,@IDSDIR@,$(IDSDIR),' \
61                 -e 's,@VERSION@,$(VERSION),' \
62                 -e 's,@LDLIBS@,$(LDLIBS),'
63
64 init.o: init.c $(INCL)
65 access.o: access.c $(INCL)
66 params.o: params.c $(INCL)
67 i386-ports.o: i386-ports.c $(INCL) i386-io-hurd.h i386-io-linux.h i386-io-sunos.h i386-io-windows.h
68 proc.o: proc.c $(INCL) pread.h
69 sysfs.o: sysfs.c $(INCL) pread.h
70 generic.o: generic.c $(INCL)
71 syscalls.o: syscalls.c $(INCL)
72 obsd-device.o: obsd-device.c $(INCL)
73 fbsd-device.o: fbsd-device.c $(INCL)
74 aix-device.o: aix-device.c $(INCL)
75 dump.o: dump.c $(INCL)
76 names.o: names.c $(INCL) names.h
77 names-cache.o: names-cache.c $(INCL) names.h
78 names-hash.o: names-hash.c $(INCL) names.h
79 names-net.o: names-net.c $(INCL) names.h
80 names-parse.o: names-parse.c $(INCL) names.h
81 filter.o: filter.c $(INCL)
82 nbsd-libpci.o: nbsd-libpci.c $(INCL)
83
84 example: example.c $(PCILIB)