blob: e4b00d331da9160245777638e12a53bd0728ede1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
$NetBSD: patch-ae,v 1.2 2011/01/18 10:34:39 markd Exp $
--- Makefile.orig 2007-12-26 16:52:36.000000000 -0800
+++ Makefile 2009-01-04 15:05:52.000000000 -0800
@@ -8,9 +8,9 @@ includedir = ${prefix}/include
libdir = ${prefix}/lib
usrlibdir = ${prefix}/lib
-INSTALL = /usr/bin/install -c
-INSTALL_DATA = ${INSTALL} -m 644
-INSTALL_LIB = ${INSTALL} -m 755
+#INSTALL = /usr/bin/install -c
+#INSTALL_DATA = ${INSTALL} -m 644
+#INSTALL_LIB = ${INSTALL} -m 755
SHLIB_CUR = 0
SHLIB_REV = 81
@@ -59,12 +59,19 @@ HEADERS= \
libvolume_id.h \
util.h
-all: libvolume_id.a $(SHLIB) libvolume_id.pc
+all: libvolume_id.la libvolume_id.pc
.PHONY: all
.DEFAULT: all
.SUFFIXES:
+libvolume_id.la: $(OBJS:.o=.lo)
+ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(CFLAGS) -o $@ \
+ $^ -version-info $(SHLIB_CUR):$(SHLIB_REV):$(SHLIB_AGE) -rpath $(PREFIX)/lib
+
+%.lo: %.c
+ $(LIBTOOL) --mode=compile $(CC) -c $(CFLAGS) -o $@ $<
+
%.o: %.c
$(E) " CC " $@
$(Q) $(CC) -c $(CFLAGS) $< -o $@
@@ -88,27 +95,22 @@ $(SHLIB): $(HEADERS) exported_symbols $(
$(addprefix .shlib/,$(OBJS))
libvolume_id.pc:
- $(E) " GENPC " $@
- $(Q) echo "libdir=${usrlibdir}" >> $@
- $(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}" >> $@
+ echo "prefix=$(PREFIX)" >> $@
+ echo "exec_prefix=\$${prefix}" >> $@
+ echo "libdir=\$${exec_prefix}/lib" >> $@
+ echo "includedir=\$${exec_prefix}/include" >> $@
+ echo "" >> $@
+ echo "Name: libvolume_id" >> $@
+ echo "Description: Filesystem label and uuid access" >> $@
+ echo "Version: $(SHLIB_CUR).$(SHLIB_REV).$(SHLIB_AGE)" >> $@
+ echo "" >> $@
+ echo "Libs: -L\$${libdir} -lvolume_id" >> $@
+ echo "Cflags: -I\$${includedir}" >> $@
install: all
- $(INSTALL_DATA) -D libvolume_id.h $(DESTDIR)$(includedir)/libvolume_id.h
- $(INSTALL_LIB) -D $(SHLIB) $(DESTDIR)$(libdir)/$(SHLIB)
- mkdir -p $(DESTDIR)$(usrlibdir)/
- ln -sf $(SHLIB) $(DESTDIR)$(libdir)/libvolume_id.so.$(SHLIB_CUR)
-ifeq ($(libdir),$(usrlibdir))
- ln -sf $(SHLIB) $(DESTDIR)$(usrlibdir)/libvolume_id.so
-else
- ln -sf $(libdir)/$(SHLIB) $(DESTDIR)$(usrlibdir)/libvolume_id.so
-endif
- $(INSTALL_DATA) -D libvolume_id.pc $(DESTDIR)$(usrlibdir)/pkgconfig/libvolume_id.pc
+ $(LIBTOOL) --mode=install $(INSTALL_LIB) libvolume_id.la $(DESTDIR)$(PREFIX)/lib
+ $(INSTALL_DATA) libvolume_id.h $(DESTDIR)$(PREFIX)/include
+ $(INSTALL_DATA) libvolume_id.pc $(DESTDIR)$(PREFIX)/lib/pkgconfig
.PHONY: install
uninstall:
|