summaryrefslogtreecommitdiff
path: root/makefile.orig
blob: f2ffeb0e92068997c088bd8220f1de6a4414611d (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
# Makefile
# James S. Plank
# 
# JERASURE - Library for Erasure Coding
# Copright (C) 2007 James S. Plank
# 
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# 
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
# 
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
# 
# James S. Plank
# Department of Electrical Engineering and Computer Science
# University of Tennessee
# Knoxville, TN 37996
# plank@cs.utk.edu

# $Revision: 1.0 $
# $Date: 2007/09/25 15:12:20 $

UNAME := $(shell uname)

ifeq ($(UNAME), Linux)
LIBARGS=-shared -Wl,-soname,libJerasure.so.0
endif
ifeq ($(UNAME), Darwin)
LIBARGS=-shared -Wl,-install_name,libJerasure.so.0
endif

PREFIX=/usr/local
BINDIR=${PREFIX}/bin
LIBDIR=${PREFIX}/lib
INCDIR=${PREFIX}/include

CC = gcc  
CFLAGS = -O3 -I${INCDIR} -L${LIBDIR} -fPIC

ALL =	galois.o jerasure.o reed_sol.o cauchy.o liberation.o lib/libJerasure.so
OBJS = galois.o jerasure.o reed_sol.o cauchy.o liberation.o

all: $(ALL)

clean:
	rm -f core *.o $(ALL) a.out lib/libJerasure.so.0

lib:
	mkdir -p lib

.SUFFIXES: .c .o
.c.o:
	$(CC) $(CFLAGS) -c $*.c

galois.o: galois.h
jerasure.o: jerasure.h galois.h
reed_sol.o: jerasure.h galois.h reed_sol.h
cauchy.o: jerasure.h galois.h cauchy.h
liberation.o: jerasure.h galois.h liberation.h

lib/libJerasure.so: lib/libJerasure.so.0
	ln -sf libJerasure.so.0 lib/libJerasure.so

lib/libJerasure.so.0: lib $(OBJS)
	$(CC) $(LIBARGS) \
	  -o lib/libJerasure.so.0 $(OBJS) -lgf_complete

install: lib/libJerasure.so
	cp -P lib/libJerasure.so* ${LIBDIR}
	mkdir -p ${INCDIR}
	cp *.h ${INCDIR}