Skip to content

Commit

Permalink
xxvethernet: Modify makefile to support parallel make execution
Browse files Browse the repository at this point in the history
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 <radhey.shyam.pandey@xilinx.com>

Acked-for-series: Harini Katakam <harini.katakam@xilinx.com>
  • Loading branch information
radheyxilinx authored and Siva Addepalli committed Sep 12, 2020
1 parent 5c50f6f commit d6867a5
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions XilinxProcessorIPLib/drivers/xxvethernet/src/Makefile
@@ -1,3 +1,4 @@
DRIVER_LIB_VERSION = 1.0
COMPILER=
ARCHIVER=
CP=cp
Expand All @@ -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)

0 comments on commit d6867a5

Please sign in to comment.