2006-03-23 12:50:55 +03:00
# libvolume_id - read filesystem label/uuid
2005-11-09 17:08:45 +03:00
#
2006-03-23 12:50:55 +03:00
# Copyright (C) 2004-2006 Kay Sievers <kay.sievers@vrfy.org>
2005-11-09 17:08:45 +03:00
#
# Released under the GNU General Public License, version 2.
#
2006-03-23 12:50:55 +03:00
includedir = ${ prefix } /usr/include
libdir = ${ prefix } /lib
usrlibdir = ${ prefix } /usr/lib
2005-11-09 17:08:45 +03:00
2006-03-23 12:50:55 +03:00
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${ INSTALL } -m 644
INSTALL_LIB = ${ INSTALL } -m 755
SHLIB_CUR = 0
2006-10-13 15:17:13 +04:00
SHLIB_REV = 73
2006-03-23 12:50:55 +03:00
SHLIB_AGE = 0
SHLIB = libvolume_id.so.$( SHLIB_CUR) .$( SHLIB_REV) .$( SHLIB_AGE)
2005-11-09 17:08:45 +03:00
OBJS = \
ext.o \
fat.o \
hfs.o \
highpoint.o \
isw_raid.o \
lsi_raid.o \
via_raid.o \
silicon_raid.o \
nvidia_raid.o \
promise_raid.o \
2006-05-15 23:57:28 +04:00
adaptec_raid.o \
jmicron_raid.o \
2005-11-09 17:08:45 +03:00
iso9660.o \
jfs.o \
linux_raid.o \
linux_swap.o \
lvm.o \
ntfs.o \
reiserfs.o \
udf.o \
ufs.o \
xfs.o \
cramfs.o \
hpfs.o \
romfs.o \
sysv.o \
minix.o \
2006-05-30 18:01:28 +04:00
gfs.o \
2005-11-09 17:08:45 +03:00
luks.o \
ocfs.o \
vxfs.o \
2006-03-08 21:44:28 +03:00
squashfs.o \
2006-05-09 10:46:07 +04:00
netware.o \
2005-11-09 17:08:45 +03:00
volume_id.o \
util.o
HEADERS = \
2006-03-23 12:50:55 +03:00
libvolume_id.h \
2005-11-09 17:08:45 +03:00
util.h
2006-03-23 12:50:55 +03:00
all : libvolume_id .a $( SHLIB ) libvolume_id .pc
2005-11-09 17:08:45 +03:00
.PHONY : all
.DEFAULT : all
%.o : %.c
2006-01-28 06:44:51 +03:00
$( E) " CC " $@
$( Q) $( CC) -c $( CFLAGS) $< -o $@
2005-11-09 17:08:45 +03:00
2006-03-23 12:50:55 +03:00
.shlib :
$( Q) mkdir .shlib
.shlib/%.o : %.c
$( E) " CC " $@
$( Q) $( CC) -c $( CFLAGS) -fPIC $< -o $@
libvolume_id.a : $( HEADERS ) $( OBJS )
2006-01-28 06:44:51 +03:00
$( Q) rm -f $@
$( E) " AR " $@
$( Q) $( AR) cq $@ $( OBJS)
$( E) " RANLIB " $@
$( Q) $( RANLIB) $@
2005-11-09 17:08:45 +03:00
2006-03-23 12:50:55 +03:00
$(SHLIB) : $( HEADERS ) .shlib $( addprefix .shlib /,$ ( OBJS ) )
$( E) " CC " $@
2006-03-28 04:52:58 +04:00
$( Q) $( CC) -shared $( CFLAGS) -o $@ \
-Wl,-soname,libvolume_id.so.$( SHLIB_CUR) ,--version-script,exported_symbols \
$( addprefix .shlib/,$( OBJS) )
2006-03-23 12:50:55 +03:00
$( Q) ln -sf $@ libvolume_id.so.$( SHLIB_CUR)
$( Q) ln -sf $@ libvolume_id.so
libvolume_id.pc :
$( E) " GENPC " $@
$( Q) echo " prefix= ${ prefix } " > $@
$( Q) echo " libdir= ${ libdir } " >> $@
$( Q) echo " includedir= ${ includedir } " >> $@
$( Q) echo "" >> $@
$( Q) echo "Name: libvolume_id" >> $@
$( Q) echo "Description: Filesystem label and uuid access" >> $@
$( Q) echo " Version: $( SHLIB_CUR) . $( SHLIB_REV) . $( SHLIB_AGE) " >> $@
$( Q) echo " Libs: -L\$ ${ libdir } -lvolume_id " >> $@
$( Q) echo " Cflags: -I\$ ${ includedir } " >> $@
install : all
$( INSTALL_DATA) -D libvolume_id.h $( DESTDIR) $( includedir) /libvolume_id.h
$( INSTALL_LIB) -D libvolume_id.a $( DESTDIR) $( usrlibdir) /libvolume_id.a
$( INSTALL_LIB) -D $( SHLIB) $( DESTDIR) $( libdir) /$( SHLIB)
2006-04-03 16:40:06 +04:00
ln -sf $( SHLIB) $( DESTDIR) $( libdir) /libvolume_id.so.$( SHLIB_CUR)
ln -sf $( libdir) /$( SHLIB) $( DESTDIR) $( usrlibdir) /libvolume_id.so
2006-03-23 12:50:55 +03:00
$( INSTALL_DATA) -D libvolume_id.pc $( DESTDIR) $( usrlibdir) /pkgconfig/libvolume_id.pc
.PHONY : install
uninstall :
rm -f $( DESTDIR) $( includedir) /libvolume_id.h
rm -f $( DESTDIR) $( usrlibdir) /libvolume_id.a
rm -f $( DESTDIR) $( libdir) /$( SHLIB)
rm -f $( DESTDIR) $( libdir) /libvolume_id.so.$( SHLIB_CUR)
rm -f $( DESTDIR) $( libdir) /libvolume_id.so
.PHONY : uninstall
2005-11-09 17:08:45 +03:00
clean :
2006-01-28 06:44:51 +03:00
$( E) " CLEAN "
2006-03-23 12:50:55 +03:00
$( Q) rm -f libvolume_id.a $( OBJS)
$( Q) rm -f $( SHLIB) libvolume_id.so.$( SHLIB_CUR) libvolume_id.so
$( Q) rm -rf .shlib
$( Q) rm -f libvolume_id.pc
2005-11-09 17:08:45 +03:00
.PHONY : clean