From 072e9699c41eccb8f5ebc7fff7c7f346aa3f7b43 Mon Sep 17 00:00:00 2001 From: Anirudha Sarangi Date: Thu, 3 Sep 2015 20:45:42 +0530 Subject: [PATCH] XilFFs: Fix makefile issues Fix makefile issues related to incremental build. Signed-off-by: Anirudha Sarangi Reviewed-by: Punnaiah Choudary Kalluri --- lib/sw_services/xilffs/src/Makefile | 61 +++++++++++------------------ 1 file changed, 23 insertions(+), 38 deletions(-) diff --git a/lib/sw_services/xilffs/src/Makefile b/lib/sw_services/xilffs/src/Makefile index 9445c1a2..0b616b1e 100644 --- a/lib/sw_services/xilffs/src/Makefile +++ b/lib/sw_services/xilffs/src/Makefile @@ -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 # of this software and associated documentation files (the "Software"), to deal @@ -33,7 +33,8 @@ COMPILER= ARCHIVER= CP=cp -COMPILER_FLAGS= +COMPILER_FLAGS = +LIB=libxilffs.a ifeq ($(notdir $(COMPILER)) , iccarm) EXTRA_ARCHIVE_FLAGS=--create @@ -47,52 +48,36 @@ endif RELEASEDIR=../../../lib INCLUDEDIR=../../../include -INCLUDES=-I./include/ -I${INCLUDEDIR} +INCLUDES=-I./. -I${INCLUDEDIR} + FATFS_DIR = . -OBJDIR = obj/ +OUTS = *.o -LIB_SRCS = $(FATFS_DIR)/ff.c \ - $(FATFS_DIR)/diskio.c +FATFS_SRCS := $(wildcard *.c) +FATFS_OBJS = $(addprefix $(FATFS_DIR)/, $(FATFS_SRCS:%.c=%.o)) - -# 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 \ +INCLUDEFILES=$(FATFS_DIR)/include/ff.h \ $(FATFS_DIR)/include/ffconf.h \ $(FATFS_DIR)/include/diskio.h \ $(FATFS_DIR)/include/integer.h - libs: libxilffs.a - cp libxilffs.a $(RELEASEDIR) - make clean -include: - @for i in $(EXPORT_INCLUDE_FILES); do \ - ${CP} -r $$i ${INCLUDEDIR}; \ - done +libxilffs.a: print_msg_fatfs $(FATFS_OBJS) + $(ARCHIVER) $(EXTRA_ARCHIVE_FLAGS) ${RELEASEDIR}/${LIB} ${OUTS} -clean: - 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: +print_msg_fatfs: @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 $@