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
81
82
83
84
85
86
87
88
|
$NetBSD: patch-ad,v 1.1.1.1 2007/09/13 10:07:36 gson Exp $
--- libdieharder/Makefile.am.orig 2007-05-22 03:34:27.000000000 +0300
+++ libdieharder/Makefile.am
@@ -38,10 +38,7 @@ RELEASE=0
# other stuff in the future) is built.
PROGMAN = libdieharder.3
# (FC "requires" no static library build)
-# PROGLIB_A = libdieharder.a
-PROGLIB_SO = libdieharder.so
-PROGLIB_SONAME = libdieharder.so.$(VERSION_MAJOR)
-PROGLIB_SO_VERSION = libdieharder.so.$(VERSION)
+PROGLIB_A = libdieharder.a
#========================================================================
# Define all sources. Note that we choose to depend on ALL the includes
@@ -61,9 +58,6 @@ CC = gcc
# Compile flags (use fairly standard -O3 as default)
CFLAGS = -O3 $(DEFINES) -I ../include
-# Linker flags
-LDFLAGS = -g -fpic -shared -Wl,-soname,$(PROGLIB_SONAME)
-
# Libraries
LIBS = -lgsl -lgslcblas -lm
@@ -72,22 +66,11 @@ LIBS = -lgsl -lgslcblas -lm
# presume the simplest of dependencies and remake if includes change
# for example.
#========================================================================
-all: $(INCTIME) $(PROGLIB_SO_VERSION) # $(PROGLIB_A)
-# This has to ALWAYS run before a build.
-$(INCTIME):
- (install -d $(includedir)/dieharder; \
- install -m 644 ../include/dieharder/*.h $(includedir)/dieharder;)
-
-# FC "requires" no static lib build/install
-# $(PROGLIB_A): $(INCTIME) $(LIBOBJECTS) $(LIBINCLUDES)
-# ar r $(PROGLIB_A) $(LIBOBJECTS)
-# ranlib $(PROGLIB_A)
-
-$(PROGLIB_SO_VERSION): $(INCTIME) $(LIBOBJECTS) $(LIBINCLUDES)
- gcc $(LDFLAGS) -o $(PROGLIB_SO_VERSION) $(LIBOBJECTS)
- ldconfig -n .
- ln -sf $(PROGLIB_SO_VERSION) $(PROGLIB_SO)
+all: $(PROGLIB_A)
+
+$(PROGLIB_A): $(LIBOBJECTS)
+ $(LIBTOOL) --mode=link gcc -o $(PROGLIB_A:.a=.la) $(LIBOBJECTS:.o=.lo) -rpath ${PREFIX}/lib -version-info 0:0
#========================================================================
# The only safe place to do commits is in the toplevel directory
@@ -111,7 +94,7 @@ printout:
# A standard cleanup target
#========================================================================
clean:
- rm -f core $(PROGLIB_SO)* $(LIBOBJECTS) $(PROGMAN).gz
+ rm -f core $(PROGLIB_A) $(LIBOBJECTS) $(PROGMAN).gz
#========================================================================
# This is critical. For the toplevel rpm build to succeed,
@@ -120,15 +103,14 @@ clean:
# This target has to install precisely the files required by the
# specfile for the dieharder package, in precisely the right locations.
#========================================================================
-install: $(PROGLIB_SO_VERSION) $(PROGLIB_A) $(PROGMAN)
+install: $(PROGLIB_A) $(PROGMAN)
(install -d $(libdir); \
- install -m 755 $(PROGLIB_SO_VERSION) $(libdir)/$(PROGLIB_SO_VERSION); \
- ln -sf $(libdir)/$(PROGLIB_SO_VERSION) $(libdir)/$(PROGLIB_SO); \
+ $(LIBTOOL) --mode=install install -m 755 $(PROGLIB_A:.a=.la) $(libdir); \
install -d $(includedir)/dieharder; \
install -m 644 ../include/dieharder/*.h $(includedir)/dieharder; \
- install -d $(prefix)/share/man/man3; \
+ install -d $(mandir)/man3; \
gzip -c -9 $(PROGMAN) > $(PROGMAN).gz; \
- install -m 644 $(DIR).3.gz $(prefix)/share/man/man3)
+ install -m 644 $(DIR).3.gz $(mandir)/man3)
# FC requires no static lib install
# install -m 755 $(PROGLIB_A) $(libdir)/$(PROGLIB_A); \
@@ -138,4 +120,4 @@ install: $(PROGLIB_SO_VERSION) $(PROGLIB
# objects.
#========================================================================
%.o:%.c $(LIBINCLUDES) Makefile
- $(CC) -fpic -c $(CFLAGS) $<
+ $(LIBTOOL) --mode=compile $(CC) -fpic -c $(CFLAGS) $<
|