Jerasure
Jerasure copied to clipboard
Makefiles fix
Hi,
I have had problems with the original Makefiles. So, I have fixed them and there is the new ones (I have seperated the headers files in the include directory):
# jerasure/Makefile
PREFIX=/usr/local
LIBDIR=${PREFIX}/lib
INCDIR=${PREFIX}/include
.PHONY: all clean install unistall lib
all: lib
$(MAKE) -C Examples
clean:
$(MAKE) -C src clean
$(MAKE) -C Examples clean
install: lib
@cp -P lib/libJerasure.so* ${LIBDIR}
@mkdir -p ${INCDIR}/jerasure
@cp include/* ${INCDIR}/jerasure
uninstall: lib
@rm ${LIBDIR}/libJerasure.so*
@rmdir ${INCDIR}/jerasure
lib:
$(MAKE) -C src
# jerasure/src/Makefile
CC = gcc
CFLAGS = -g -O3 -fPIC -Wall -Werror -I../include
SRCS = galois.c jerasure.c reed_sol.c cauchy.c liberation.c
OBJS = $(SRCS:.c=.o)
LIB = libJerasure.so
LIBDIR = ../lib
.PHONY: all lib ../lib compile
all: lib
lib: ../lib compile
$(CC) -shared -Wl,-soname,$(LIB) \
-o $(LIBDIR)/$(LIB).0 $(OBJS)
@ln -sf $(LIB).0 $(LIBDIR)/$(LIB)
../lib:
@mkdir -p ../lib
clean:
$(RM) $(RMFLAGS) $(LIBDIR)/$(LIB)* $(OBJS) $(wildcard *.d)
compile: $(OBJS)
%.d: %.c
@$(SHELL) -ec '$(CC) -M $(CFLAGS) $< \
| sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
[ -s $@ ] || rm -f $@'
-include $(SRC:.c=.d)
# jerasure/Examples/Makefile
CC = gcc
CFLAGS = -g -Wall -Werror -I../include
LDFLAGS = -L../lib
LDLIBS = -lJerasure
SRCS = $(wildcard *.c)
OBJS = $(SRCS:.c=.o)
TARGETS = $(SRCS:.c=)
all: $(TARGETS)
compile: lib $(OBJS)
clean:
$(RM) $(RMFLAGS) $(OBJS) $(TARGETS)
lib:
$(MAKE) -C ../src/
I have tried to take off all warnings too, but one of them let doubt. In jerasure.c file there is the jerasure_smart_bitmatrix_to_schedule function, and the variable bestrow could be used without be initialized, that was the warning that the compiler gave when I use -Wall compiler's flag. So, I have initialized this variable with zero, but could that variable really pass through that two "for" without be initialized?
Thanks for your attention.