blob: 189b089943a9b5af2f429afd492f3fa9d6bef524 (
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
|
$NetBSD: patch-ac,v 1.2 2009/11/30 17:25:08 joerg Exp $
--- dieharder/Makefile.am.orig 2007-05-22 02:34:27.000000000 +0200
+++ dieharder/Makefile.am
@@ -46,7 +46,6 @@ SRCINCLUDES = $(shell ls *.h 2>&1 | sed
# see how to force a consistent build when working on the UI
# and library at the same time. Maybe with particular make targets...
LIBINCLUDES = $(shell ls ../include/dieharder/*.h 2>&1 | sed -e "/\/bin\/ls:/d")
-PROGLIB_SONAME = $(LIBDIR)/libdieharder.so.$(VERSION)
SOURCES = $(LIBSOURCES) $(SRCSOURCES)
INCLUDES = $(LIBINCLUDES) $(SRCINCLUDES)
@@ -57,17 +56,11 @@ DEFINES = -DVERSION=$(VERSION)
#========================================================================
# Define parameters and directives needed in compile/link steps.
#========================================================================
-# C Compiler
-CC = gcc
-
# Compile flags (use fairly standard -O3 as default)
-CFLAGS = -O3 -I ../include $(DEFINES)
-
-# Linker flags.
-LDFLAGS =
+CFLAGS += -I ../include $(DEFINES)
# Libraries
-LIBS = -L ../libdieharder -ldieharder -lgsl -lgslcblas -lm
+LIBS = ../libdieharder/libdieharder.la -lgsl -lgslcblas -lm
#========================================================================
# List of variants one can make. all is the default. We always
@@ -76,18 +69,8 @@ LIBS = -L ../libdieharder -ldieharder -l
#========================================================================
all: $(PROGRAM)
-$(PROGRAM): $(OBJECTS) $(PROGLIB_SONAME)
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS)
-
-#========================================================================
-# This is cautiously permitted. REALLY, though, we need a conditional
-# that punts with a warning if we try this during an rpm build and
-# the library is not found -- the right solution then is to install
-# the library first!
-#========================================================================
-$(PROGLIB_SONAME):
- - (cd ../libdieharder ;\
- $(MAKE))
+$(PROGRAM): $(OBJECTS) ../libdieharder/libdieharder.la
+ $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS)
#========================================================================
# The only safe place to do commits is in the toplevel directory
@@ -123,15 +106,15 @@ clean :
install : $(PROGRAM)
(strip $(PROGRAM);\
install -d $(prefix)/bin; \
- install -m 755 $(PROGRAM) $(prefix)/bin; \
- install -d $(prefix)/share/man/man1; \
+ $(LIBTOOL) --mode=install install -m 755 $(PROGRAM) $(prefix)/bin; \
+ install -d $(mandir)/man1; \
gzip -c -9 $(PROGRAM).1 > $(PROGRAM).1.gz; \
- install -m 644 $(PROGRAM).1.gz $(prefix)/share/man/man1)
+ install -m 644 $(PROGRAM).1.gz $(mandir)/man1)
#========================================================================
# We give all generic rules below. Currently we only need a rule for
# objects.
#========================================================================
%.o:%.c
- $(CC) -c $(CFLAGS) $<
+ $(LIBTOOL) --mode=compile $(CC) -c $(CFLAGS) $<
|