Skip to content

Commit

Permalink
axiethernet: 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>

Acked-for-series: Harini Katakam<harini.katakam@xilinx.com>
  • Loading branch information
radheyxilinx authored and Siva Addepalli committed Oct 1, 2020
1 parent 314418f commit ad47394
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions XilinxProcessorIPLib/drivers/axiethernet/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 xaxiethernet_libs clean
DEPFILES := $(SRCFILES:%.c=$(RELEASEDIR)%.d)

%.o: %.c
${COMPILER} $(CC_FLAGS) $(ECC_FLAGS) $(INCLUDES) -o $@ $<
include $(wildcard $(DEPFILES))

banner:
echo "Compiling axiethernet"
include $(wildcard ../../../../dep.mk)

xaxiethernet_libs: ${OBJECTS}
$(ARCHIVER) -r ${RELEASEDIR}/${LIB} ${OBJECTS}
$(RELEASEDIR)%.o: %.c
${COMPILER} $(CC_FLAGS) $(ECC_FLAGS) $(INCLUDES) $(DEPENDENCY_FLAGS) $(realpath $<) -o $@

.PHONY: include
include: xaxiethernet_includes
include: $(addprefix $(INCLUDEDIR),$(wildcard *.h))

xaxiethernet_includes:
${CP} ${INCLUDEFILES} ${INCLUDEDIR}
$(INCLUDEDIR)%.h: %.h
$(CP) $< $@

clean:
rm -rf ${OBJECTS}
rm -rf $(DEPFILES)

0 comments on commit ad47394

Please sign in to comment.