This is an automatic generated email to let you know that the following patch 
were queued:

Subject: edid-decode: Rewrite build to accept multiple jobs
Author:  Bård Eirik Winther <bwint...@cisco.com>
Date:    Wed Jun 15 15:27:47 2022 +0200

Change the compilation from a single command to building object
files before linking. Allows for parallel compilation.

Signed-off-by: Bård Eirik Winther <bwint...@cisco.com>
Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl>
[hverkuil: revert the build rule for edid-decode.js, that didn't work]

 Makefile | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

---

diff --git a/Makefile b/Makefile
index 91ef531fb6a2..dc597f024f28 100644
--- a/Makefile
+++ b/Makefile
@@ -14,10 +14,9 @@ endif
 
 EMXX ?= em++
 
-SOURCES = edid-decode.cpp parse-base-block.cpp parse-cta-block.cpp \
-         parse-displayid-block.cpp parse-ls-ext-block.cpp \
-         parse-di-ext-block.cpp parse-vtb-ext-block.cpp \
-         calc-gtf-cvt.cpp calc-ovt.cpp
+SOURCES = $(wildcard *.cpp)
+OBJECTS := $(patsubst %.cpp, _build/%.o, $(SOURCES))
+
 WARN_FLAGS = -Wall -Wextra -Wno-missing-field-initializers 
-Wno-unused-parameter -Wimplicit-fallthrough
 
 all: edid-decode
@@ -25,13 +24,20 @@ all: edid-decode
 sha = -DSHA=$(shell if test -d .git ; then git rev-parse --short=12 HEAD ; fi)
 date = -DDATE=$(shell if test -d .git ; then TZ=UTC git show --quiet 
--date='format-local:"%F %T"' --format='%cd'; fi)
 
-edid-decode: $(SOURCES) edid-decode.h oui.h Makefile
-       $(CXX) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(WARN_FLAGS) -g $(sha) $(date) 
-o $@ $(SOURCES) -lm
+edid-decode: makebuilddir $(OBJECTS) edid-decode.h oui.h Makefile
+       $(CXX) $(LDFLAGS) $(WARN_FLAGS) -g $(sha) $(date) -o $@ $(OBJECTS) -lm
 
 edid-decode.js: $(SOURCES) edid-decode.h oui.h Makefile
        $(EMXX) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(WARN_FLAGS) $(sha) $(date) 
-s EXPORTED_FUNCTIONS='["_parse_edid"]' -s EXPORTED_RUNTIME_METHODS='["ccall", 
"cwrap"]' -o $@ $(SOURCES) -lm
 
+_build/%.o: %.cpp
+       $(CXX) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(WARN_FLAGS) -g $(sha) $(date) 
-o $@ -c $<
+
+makebuilddir:
+       mkdir -p _build
+
 clean:
+       rm -rf _build
        rm -f edid-decode edid-decode.js edid-decode.wasm
 
 install:

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to