Commit 67e2a28396b90ab20a17ccb6cc46e23fa86338a7

Authored by KMG
1 parent c28c67fa
Exists in master and in 1 other branch v2

makefile works on Darwin and Linux

Showing 1 changed file with 11 additions and 2 deletions   Show diff stats
makefile
... ... @@ -27,6 +27,15 @@
27 27 # $Revision: 1.0 $
28 28 # $Date: 2007/09/25 15:12:20 $
29 29  
  30 +UNAME := $(shell uname)
  31 +
  32 +ifeq ($(UNAME), Linux)
  33 +LIBARGS=-shared -Wl,-soname,libJerasure.so.0
  34 +endif
  35 +ifeq ($(UNAME), Darwin)
  36 +LIBARGS=-shared -Wl,-install_name,libJerasure.so.0
  37 +endif
  38 +
30 39 PREFIX=/usr/local
31 40 BINDIR=${PREFIX}/bin
32 41 LIBDIR=${PREFIX}/lib
... ... @@ -41,7 +50,7 @@ OBJS = galois.o jerasure.o reed_sol.o cauchy.o liberation.o
41 50 all: $(ALL)
42 51  
43 52 clean:
44   - rm -f core *.o $(ALL) a.out
  53 + rm -f core *.o $(ALL) a.out lib/libJerasure.so.0
45 54  
46 55 lib:
47 56 mkdir -p lib
... ... @@ -60,7 +69,7 @@ lib/libJerasure.so: lib/libJerasure.so.0
60 69 ln -sf libJerasure.so.0 lib/libJerasure.so
61 70  
62 71 lib/libJerasure.so.0: lib $(OBJS)
63   - $(CC) -shared -Wl,-soname,libJerasure.so.0 \
  72 + $(CC) $(LIBARGS) \
64 73 -o lib/libJerasure.so.0 $(OBJS) ${LIBDIR}/gf_complete.a
65 74  
66 75 install: lib/libJerasure.so
... ...