Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefiles fix #4

Open
tiberiomoliveira opened this issue May 12, 2012 · 0 comments
Open

Makefiles fix #4

tiberiomoliveira opened this issue May 12, 2012 · 0 comments

Comments

@tiberiomoliveira
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant