From d6867a5c0012bbb5f666cd79c932776b28828f00 Mon Sep 17 00:00:00 2001 From: Radhey Shyam Pandey Date: Tue, 1 Sep 2020 21:57:49 +0530 Subject: [PATCH] xxvethernet: Modify makefile to support parallel make execution Modify the driver makefile to support the parallel make execution. This will reduce the compile time drastically as it will only compile the files those have timestamp modified. Signed-off-by: Radhey Shyam Pandey Acked-for-series: Harini Katakam --- .../drivers/xxvethernet/src/Makefile | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/XilinxProcessorIPLib/drivers/xxvethernet/src/Makefile b/XilinxProcessorIPLib/drivers/xxvethernet/src/Makefile index 58f73bbf555..4f98f91dc5a 100644 --- a/XilinxProcessorIPLib/drivers/xxvethernet/src/Makefile +++ b/XilinxProcessorIPLib/drivers/xxvethernet/src/Makefile @@ -1,3 +1,4 @@ +DRIVER_LIB_VERSION = 1.0 COMPILER= ARCHIVER= CP=cp @@ -8,33 +9,31 @@ LIB=libxil.a CC_FLAGS = $(COMPILER_FLAGS) ECC_FLAGS = $(EXTRA_COMPILER_FLAGS) -RELEASEDIR=../../../lib -INCLUDEDIR=../../../include -INCLUDES=-I./. -I${INCLUDEDIR} +RELEASEDIR=../../../lib/ +INCLUDEDIR=../../../include/ +INCLUDES=-I./. -I$(INCLUDEDIR) -OUTS = *.o +SRCFILES:=$(wildcard *.c) -LIBSOURCES:=*.c -INCLUDEFILES:=*.h +OBJECTS = $(addprefix $(RELEASEDIR), $(addsuffix .o, $(basename $(wildcard *.c)))) -OBJECTS = $(addsuffix .o, $(basename $(wildcard *.c))) +libs: $(OBJECTS) -libs: banner xxvethernet_libs clean +DEPFILES := $(SRCFILES:%.c=$(RELEASEDIR)%.d) -%.o: %.c - ${COMPILER} $(CC_FLAGS) $(ECC_FLAGS) $(INCLUDES) -o $@ $< +include $(wildcard $(DEPFILES)) -banner: - echo "Compiling xxvethernet" +include $(wildcard ../../../../dep.mk) -xxvethernet_libs: ${OBJECTS} - $(ARCHIVER) -r ${RELEASEDIR}/${LIB} ${OBJECTS} +$(RELEASEDIR)%.o: %.c + ${COMPILER} $(CC_FLAGS) $(ECC_FLAGS) $(INCLUDES) $(DEPENDENCY_FLAGS) $(realpath $<) -o $@ .PHONY: include -include: xxvethernet_includes +include: $(addprefix $(INCLUDEDIR),$(wildcard *.h)) -xxvethernet_includes: - ${CP} ${INCLUDEFILES} ${INCLUDEDIR} +$(INCLUDEDIR)%.h: %.h + $(CP) $< $@ clean: rm -rf ${OBJECTS} + rm -rf $(DEPFILES)