XilFFs: 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
edfa3762db
commit
072e9699c4
1 changed files with 23 additions and 38 deletions
|
@ -1,6 +1,6 @@
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# Copyright (C) 2013 - 2014 Xilinx, Inc. All rights reserved.
|
# Copyright (C) 2013 - 2015 Xilinx, Inc. All rights reserved.
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
# of this software and associated documentation files (the "Software"), to deal
|
# of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -33,7 +33,8 @@
|
||||||
COMPILER=
|
COMPILER=
|
||||||
ARCHIVER=
|
ARCHIVER=
|
||||||
CP=cp
|
CP=cp
|
||||||
COMPILER_FLAGS=
|
COMPILER_FLAGS =
|
||||||
|
LIB=libxilffs.a
|
||||||
|
|
||||||
ifeq ($(notdir $(COMPILER)) , iccarm)
|
ifeq ($(notdir $(COMPILER)) , iccarm)
|
||||||
EXTRA_ARCHIVE_FLAGS=--create
|
EXTRA_ARCHIVE_FLAGS=--create
|
||||||
|
@ -47,52 +48,36 @@ endif
|
||||||
|
|
||||||
RELEASEDIR=../../../lib
|
RELEASEDIR=../../../lib
|
||||||
INCLUDEDIR=../../../include
|
INCLUDEDIR=../../../include
|
||||||
INCLUDES=-I./include/ -I${INCLUDEDIR}
|
INCLUDES=-I./. -I${INCLUDEDIR}
|
||||||
|
|
||||||
FATFS_DIR = .
|
FATFS_DIR = .
|
||||||
OBJDIR = obj/
|
OUTS = *.o
|
||||||
|
|
||||||
LIB_SRCS = $(FATFS_DIR)/ff.c \
|
FATFS_SRCS := $(wildcard *.c)
|
||||||
$(FATFS_DIR)/diskio.c
|
FATFS_OBJS = $(addprefix $(FATFS_DIR)/, $(FATFS_SRCS:%.c=%.o))
|
||||||
|
|
||||||
|
INCLUDEFILES=$(FATFS_DIR)/include/ff.h \
|
||||||
# create FATFS_SRCS based on configured options
|
|
||||||
|
|
||||||
FATFS_SRCS = $(LIB_SRCS)
|
|
||||||
|
|
||||||
FATFS_OBJS = $(addprefix $(OBJDIR), $(FATFS_SRCS:%.c=%.o))
|
|
||||||
|
|
||||||
|
|
||||||
EXPORT_INCLUDE_FILES = $(FATFS_DIR)/include/ff.h \
|
|
||||||
$(FATFS_DIR)/include/ffconf.h \
|
$(FATFS_DIR)/include/ffconf.h \
|
||||||
$(FATFS_DIR)/include/diskio.h \
|
$(FATFS_DIR)/include/diskio.h \
|
||||||
$(FATFS_DIR)/include/integer.h
|
$(FATFS_DIR)/include/integer.h
|
||||||
|
|
||||||
|
|
||||||
libs: libxilffs.a
|
libs: libxilffs.a
|
||||||
cp libxilffs.a $(RELEASEDIR)
|
|
||||||
make clean
|
|
||||||
|
|
||||||
include:
|
libxilffs.a: print_msg_fatfs $(FATFS_OBJS)
|
||||||
@for i in $(EXPORT_INCLUDE_FILES); do \
|
$(ARCHIVER) $(EXTRA_ARCHIVE_FLAGS) ${RELEASEDIR}/${LIB} ${OUTS}
|
||||||
${CP} -r $$i ${INCLUDEDIR}; \
|
|
||||||
done
|
|
||||||
|
|
||||||
clean:
|
print_msg_fatfs:
|
||||||
rm -rf obj/ff.o obj/diskio.o
|
|
||||||
rmdir obj
|
|
||||||
rm libxilffs.a
|
|
||||||
|
|
||||||
|
|
||||||
libxilffs.a: obj_dir print_msg_fatfs_base $(FATFS_OBJS)
|
|
||||||
@echo "Creating archive $@"
|
|
||||||
$(ARCHIVER) $(EXTRA_ARCHIVE_FLAGS) $@ obj/ff.o obj/diskio.o
|
|
||||||
|
|
||||||
|
|
||||||
obj_dir:
|
|
||||||
mkdir -p obj
|
|
||||||
|
|
||||||
print_msg_fatfs_base:
|
|
||||||
@echo "Compiling XilFFs Library"
|
@echo "Compiling XilFFs Library"
|
||||||
|
|
||||||
$(OBJDIR)%.o: $(FATFS_DIR)/%.c
|
.PHONY: include
|
||||||
|
include: libxilffs_includes
|
||||||
|
|
||||||
|
libxilffs_includes:
|
||||||
|
${CP} ${INCLUDEFILES} ${INCLUDEDIR}
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf $(FATFS_DIR)/${OUTS}
|
||||||
|
rm -rf ${RELEASEDIR}/${LIB}
|
||||||
|
|
||||||
|
$(FATFS_DIR)/%.o: $(FATFS_DIR)/%.c $(INCLUDEFILES)
|
||||||
$(COMPILER) $(COMPILER_FLAGS) $(EXTRA_COMPILER_FLAGS) $(INCLUDES) -c $< -o $@
|
$(COMPILER) $(COMPILER_FLAGS) $(EXTRA_COMPILER_FLAGS) $(INCLUDES) -c $< -o $@
|
||||||
|
|
Loading…
Add table
Reference in a new issue