XilIsf: Fix makefile issues
Fix makefile issues related to incremental build. Signed-off-by: Anirudha Sarangi <anirudh@xilinx.com> Reviewed-by: Punnaiah Choudary Kalluri <punnaia@xilinx.com>
This commit is contained in:
parent
51aeb5446b
commit
2e734c19ae
1 changed files with 25 additions and 40 deletions
|
@ -35,55 +35,40 @@ ARCHIVER=
|
||||||
CP=cp
|
CP=cp
|
||||||
COMPILER_FLAGS=
|
COMPILER_FLAGS=
|
||||||
EXTRA_COMPILER_FLAGS=
|
EXTRA_COMPILER_FLAGS=
|
||||||
|
EXTRA_ARCHIVE_FLAGS=rc
|
||||||
|
LIB=libxilisf.a
|
||||||
|
|
||||||
RELEASEDIR=../../../lib
|
RELEASEDIR=../../../lib
|
||||||
INCLUDEDIR=../../../include
|
INCLUDEDIR=../../../include
|
||||||
INCLUDES=-I${INCLUDEDIR}
|
INCLUDES=-I./. -I${INCLUDEDIR}
|
||||||
ISF_DIR = .
|
|
||||||
|
|
||||||
LIB_SRCS = $(ISF_DIR)/xilisf.c \
|
XILISF_DIR = .
|
||||||
$(ISF_DIR)/xilisf_read.c \
|
OUTS = *.o
|
||||||
$(ISF_DIR)/xilisf_erase.c \
|
|
||||||
$(ISF_DIR)/xilisf_write.c \
|
|
||||||
$(ISF_DIR)/xilisf_spr.c
|
|
||||||
|
|
||||||
# create ISF_SRCS based on configured options
|
XILISF_SRCS := $(wildcard *.c)
|
||||||
|
XILISF_OBJS = $(addprefix $(XILISF_DIR)/, $(XILISF_SRCS:%.c=%.o))
|
||||||
ISF_SRCS = $(LIB_SRCS)
|
|
||||||
|
|
||||||
ISF_OBJS = $(ISF_SRCS:%.c=%.o)
|
|
||||||
|
|
||||||
|
|
||||||
EXPORT_INCLUDE_FILES = $(ISF_DIR)/include/xilisf.h \
|
|
||||||
$(ISF_DIR)/include/xilisf_atmel.h \
|
|
||||||
$(ISF_DIR)/include/xilisf_intelstm.h
|
|
||||||
|
|
||||||
|
INCLUDEFILES=$(XILISF_DIR)/include/xilisf.h \
|
||||||
|
$(XILISF_DIR)/include/xilisf_atmel.h \
|
||||||
|
$(XILISF_DIR)/include/xilisf_intelstm.h
|
||||||
|
|
||||||
libs: libxilisf.a
|
libs: libxilisf.a
|
||||||
cp libxilisf.a $(RELEASEDIR)
|
|
||||||
make clean
|
|
||||||
|
|
||||||
include:
|
libxilisf.a: print_msg_xilisf $(XILISF_OBJS)
|
||||||
@for i in $(EXPORT_INCLUDE_FILES); do \
|
$(ARCHIVER) $(EXTRA_ARCHIVE_FLAGS) ${RELEASEDIR}/${LIB} ${OUTS}
|
||||||
echo ${CP} -r $$i ${INCLUDEDIR}; \
|
|
||||||
${CP} -r $$i ${INCLUDEDIR}; \
|
|
||||||
done
|
|
||||||
|
|
||||||
clean:
|
print_msg_xilisf:
|
||||||
rm -rf obj/*.o
|
|
||||||
rmdir obj
|
|
||||||
rm libxilisf.a
|
|
||||||
|
|
||||||
|
|
||||||
libxilisf.a: obj_dir print_msg_isf_base $(ISF_OBJS)
|
|
||||||
@echo "Creating archive $@"
|
|
||||||
$(ARCHIVER) rc $@ obj/*.o
|
|
||||||
|
|
||||||
obj_dir:
|
|
||||||
mkdir obj
|
|
||||||
|
|
||||||
print_msg_isf_base:
|
|
||||||
@echo "Compiling XilIsf Library"
|
@echo "Compiling XilIsf Library"
|
||||||
|
|
||||||
.c.o:
|
.PHONY: include
|
||||||
$(COMPILER) $(COMPILER_FLAGS) $(EXTRA_COMPILER_FLAGS) $(INCLUDES) -c $< -o obj/$(@F)
|
include: libxilisf_includes
|
||||||
|
|
||||||
|
libxilisf_includes:
|
||||||
|
${CP} ${INCLUDEFILES} ${INCLUDEDIR}
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf $(XILISF_DIR)/${OUTS}
|
||||||
|
rm -rf ${RELEASEDIR}/${LIB}
|
||||||
|
|
||||||
|
$(XILISF_DIR)/%.o: $(XILISF_DIR)/%.c $(INCLUDEFILES)
|
||||||
|
$(COMPILER) $(COMPILER_FLAGS) $(EXTRA_COMPILER_FLAGS) $(INCLUDES) -c $< -o $@
|
||||||
|
|
Loading…
Add table
Reference in a new issue