Skip to content

Commit

Permalink
iicps: 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 as it will only compile the files
which have timestamp modified.

Signed-off-by: Raviteja Narayanam <raviteja.narayanam@xilinx.com>

Acked-for-series: Srinivas Goud <srinivas.goud@xilinx.com>
  • Loading branch information
Raviteja Narayanam authored and Siva Addepalli committed Sep 8, 2020
1 parent 7c110f0 commit 5b6d022
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions XilinxProcessorIPLib/drivers/iicps/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 xiicps_libs clean
DEPFILES := $(SRCFILES:%.c=$(RELEASEDIR)%.d)

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

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

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

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

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

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

0 comments on commit 5b6d022

Please sign in to comment.