diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-03-14 17:20:45 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-03-14 17:20:45 +0000 |
commit | 7e317d016823fa511dd2cf20827543b3375ac377 (patch) | |
tree | 90caf27f3ad9582857132d8db42759c260cfc722 /Makefile | |
parent | 6ac7e5b3e35f4a9382e714f8331bc6bfc947f6e9 (diff) | |
download | ldetect-7e317d016823fa511dd2cf20827543b3375ac377.tar ldetect-7e317d016823fa511dd2cf20827543b3375ac377.tar.gz ldetect-7e317d016823fa511dd2cf20827543b3375ac377.tar.bz2 ldetect-7e317d016823fa511dd2cf20827543b3375ac377.tar.xz ldetect-7e317d016823fa511dd2cf20827543b3375ac377.zip |
libify and simplify
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 26 |
1 files changed, 17 insertions, 9 deletions
@@ -1,3 +1,6 @@ +LIB_MAJOR = 0.6 +LIB_MINOR = 0 + project = ldetect prefix = /usr bindir = $(prefix)/bin @@ -5,17 +8,22 @@ libdir = $(prefix)/lib includedir = $(prefix)/include binaries = lspcidrake -libraries = libldetect.a +lib_major = libldetect.so.$(LIB_MAJOR) +libraries = libldetect.so $(lib_major) $(lib_major).$(LIB_MINOR) CFLAGS = -Wall -W -Wstrict-prototypes -Os -fPIC RPM ?= $(HOME)/rpm build: $(binaries) $(libraries) -lspcidrake: lspcidrake.c libldetect.a +lspcidrake: lspcidrake.c libldetect.so -libldetect.a: common.o pciusb.o pci.o usb.o pciclass.o usbclass.o dmi.o - ar rsc $@ $^ +$(lib_major).$(LIB_MINOR): common.o pciusb.o pci.o usb.o pciclass.o usbclass.o dmi.o + $(CC) -shared -Wl,-soname,$(lib_major) -o $@ $^ +$(lib_major): $(lib_major).$(LIB_MINOR) + ln -sf $< $@ +libldetect.so: $(lib_major) + ln -sf $< $@ pciclass.c: /usr/include/linux/pci.h /usr/include/linux/pci_ids.h rm -f $@ @@ -27,10 +35,10 @@ usbclass.c: /usr/share/usb.ids perl generate_usbclass.pl $^ > $@ chmod a-w $@ -pciusb.o: pciusb.c libldetect.h libldetect-private.h common.h -pci.o: pci.c libldetect.h libldetect-private.h common.h -usb.o: usb.c libldetect.h libldetect-private.h common.h -dmi.o: dmi.c libldetect.h libldetect-private.h common.h +pciusb.o: pciusb.c libldetect.h common.h +pci.o: pci.c libldetect.h common.h +usb.o: usb.c libldetect.h common.h +dmi.o: dmi.c libldetect.h common.h clean: rm -f *~ *.o pciclass.c usbclass.c $(binaries) $(libraries) @@ -38,7 +46,7 @@ clean: install: build install -d $(bindir) $(libdir) $(includedir) install $(binaries) $(bindir) - install $(libraries) $(libdir) + cp -a $(libraries) $(libdir) install libldetect.h $(includedir) rpm: srpm |