Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "Kacper Michajłow" <code@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH] fftools/resources: Fix double-build by disabling .d file generation (PR #20226)
Date: Tue, 12 Aug 2025 22:10:19 +0300 (EEST)
Message-ID: <20250812191019.9BE8B68CD4E@ffbox0-bg.ffmpeg.org> (raw)

PR #20226 opened by Kacper Michajłow (kasper93)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20226
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20226.patch


From fa6cae37d5885a894ef726adf3fc44ce1fa535b2 Mon Sep 17 00:00:00 2001
From: softworkz <softworkz@hotmail.com>
Date: Mon, 23 Jun 2025 14:56:19 +0200
Subject: [PATCH 1/3] fftools/resources: Fix double-build by disabling .d file
 generation

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 ffbuild/common.mak         |  6 ++----
 fftools/Makefile           |  1 +
 fftools/resources/Makefile | 12 +++++++++---
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/ffbuild/common.mak b/ffbuild/common.mak
index ddf48923ea..81e8a46d0c 100644
--- a/ffbuild/common.mak
+++ b/ffbuild/common.mak
@@ -229,11 +229,9 @@ SKIPHEADERS += $(ARCH_HEADERS:%=$(ARCH)/%) $(SKIPHEADERS-)
 SKIPHEADERS := $(SKIPHEADERS:%=$(SUBDIR)%)
 HOBJS        = $(filter-out $(SKIPHEADERS:.h=.h.o),$(ALLHEADERS:.h=.h.o))
 PTXOBJS      = $(filter %.ptx.o,$(OBJS))
-RESOURCEOBJS = $(filter %.css.o %.html.o,$(OBJS))
 $(HOBJS):     CCFLAGS += $(CFLAGS_HEADERS)
 checkheaders: $(HOBJS)
-.SECONDARY:   $(HOBJS:.o=.c) $(PTXOBJS:.o=.c) $(PTXOBJS:.o=.gz) $(PTXOBJS:.o=) $(RESOURCEOBJS:.o=.c) $(RESOURCEOBJS:%.css.o=%.css.min) $(RESOURCEOBJS:%.css.o=%.css.min.gz) $(RESOURCEOBJS:%.html.o=%.html.gz) $(RESOURCEOBJS:.o=)
-
+.SECONDARY:   $(HOBJS:.o=.c) $(PTXOBJS:.o=.c) $(PTXOBJS:.o=.gz) $(PTXOBJS:.o=)
 alltools: $(TOOLS)
 
 $(HOSTOBJS): %.o: %.c
@@ -252,7 +250,7 @@ $(TOOLOBJS): | tools
 
 OUTDIRS := $(OUTDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(SHLIBOBJS) $(STLIBOBJS) $(TESTOBJS))
 
-CLEANSUFFIXES     = *.d *.gcda *.gcno *.h.c *.ho *.map *.o *.objs *.pc *.ptx *.ptx.gz *.ptx.c *.ver *.version *.html.gz *.html.c *.css.gz *.css.c  *$(DEFAULT_X86ASMD).asm *~ *.ilk *.pdb
+CLEANSUFFIXES     = *.d *.gcda *.gcno *.h.c *.ho *.map *.o *.objs *.pc *.ptx *.ptx.gz *.ptx.c *.ver *.version *.html.gz *.html.c *.css.min.gz *.css.min *.css.c  *$(DEFAULT_X86ASMD).asm *~ *.ilk *.pdb
 LIBSUFFIXES       = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
 
 define RULES
diff --git a/fftools/Makefile b/fftools/Makefile
index b3c08ae5a0..bdb44fc5ce 100644
--- a/fftools/Makefile
+++ b/fftools/Makefile
@@ -36,6 +36,7 @@ OBJS-ffmpeg +=                  \
     fftools/textformat/tw_buffer.o    \
     fftools/textformat/tw_stdout.o    \
     $(OBJS-resman)                    \
+    $(RESOBJS)                        \
 
 OBJS-ffprobe +=                       \
     fftools/textformat/avtextformat.o \
diff --git a/fftools/resources/Makefile b/fftools/resources/Makefile
index 8579a52678..3c936484d1 100644
--- a/fftools/resources/Makefile
+++ b/fftools/resources/Makefile
@@ -4,10 +4,16 @@ clean::
 vpath %.html $(SRC_PATH)
 vpath %.css  $(SRC_PATH)
 
-# Uncomment to prevent deletion during build
-#.PRECIOUS: %.css.c %.css.min %.css.gz %.css.min.gz %.html.gz %.html.c
-
 OBJS-resman +=                     \
     fftools/resources/resman.o     \
+
+
+RESOBJS +=                         \
     fftools/resources/graph.html.o \
     fftools/resources/graph.css.o  \
+
+
+$(RESOBJS): CCDEP       =
+$(RESOBJS): CC_DEPFLAGS =
+
+.SECONDARY: $(RESOBJS:.o=.gz) $(RESOBJS:.o=.c) $(RESOBJS:%.css.o=%.css.min) $(RESOBJS:%.css.o=%.css.min.gz) $(RESOBJS:%.html.o=%.html.gz) $(RESOBJS:.o=)
-- 
2.49.1


From 2164130fe6fb9ffa5a03a02a1a63f3e6e745a0bd Mon Sep 17 00:00:00 2001
From: softworkz <softworkz@hotmail.com>
Date: Tue, 27 May 2025 23:24:20 +0200
Subject: [PATCH 2/3] ffbuild/commonmak: Consolidate pattern rules for
 compression

This commit simplifies and consolidates all the rules around
ptx and resource file compression.

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 ffbuild/common.mak | 43 +++++++++++++++++--------------------------
 1 file changed, 17 insertions(+), 26 deletions(-)

diff --git a/ffbuild/common.mak b/ffbuild/common.mak
index 81e8a46d0c..0a60d01623 100644
--- a/ffbuild/common.mak
+++ b/ffbuild/common.mak
@@ -115,6 +115,12 @@ COMPILE_LASX = $(call COMPILE,CC,LASXFLAGS)
 $(BIN2CEXE): ffbuild/bin2c_host.o
 	$(HOSTLD) $(HOSTLDFLAGS) $(HOSTLD_O) $^ $(HOSTEXTRALIBS)
 
+RUN_BIN2C = $(BIN2C) $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<) $@ $(subst .,_,$(basename $(notdir $@)))
+RUN_GZIP  = $(M)gzip -nc9 $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<) >$@
+RUN_MINIFY = $(M)sed 's!/\\*.*\\*/!!g' $< | tr '\n' ' ' | tr -s ' ' | sed 's/^ //; s/ $$//' > $@
+%.gz: TAG = GZIP
+%.min: TAG = MINIFY
+
 %.metal.air: %.metal
 	$(METALCC) $< -o $@
 
@@ -122,61 +128,46 @@ $(BIN2CEXE): ffbuild/bin2c_host.o
 	$(METALLIB) --split-module-without-linking $< -o $@
 
 %.metallib.c: %.metallib $(BIN2CEXE)
-	$(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
+	$(RUN_BIN2C)
 
 %.ptx: %.cu $(SRC_PATH)/compat/cuda/cuda_runtime.h
 	$(COMPILE_NVCC)
 
 ifdef CONFIG_PTX_COMPRESSION
-%.ptx.gz: TAG = GZIP
 %.ptx.gz: %.ptx
-	$(M)gzip -nc9 $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<) >$@
+	$(RUN_GZIP)
 
 %.ptx.c: %.ptx.gz $(BIN2CEXE)
-	$(BIN2C) $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<) $@ $(subst .,_,$(basename $(notdir $@)))
+	$(RUN_BIN2C)
 else
 %.ptx.c: %.ptx $(BIN2CEXE)
-	$(BIN2C) $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<) $@ $(subst .,_,$(basename $(notdir $@)))
+	$(RUN_BIN2C)
 endif
 
-# 1) Preprocess CSS to a minified version
-%.css.min: TAG = SED
 %.css.min: %.css
-	$(M)sed 's!/\\*.*\\*/!!g' $< \
-	| tr '\n' ' ' \
-	| tr -s ' ' \
-	| sed 's/^ //; s/ $$//' \
-	> $@
+	$(RUN_MINIFY)
 
 ifdef CONFIG_RESOURCE_COMPRESSION
 
-# 2) Gzip the minified CSS
-%.css.min.gz: TAG = GZIP
 %.css.min.gz: %.css.min
-	$(M)gzip -nc9 $< > $@
+	$(RUN_GZIP)
 
-# 3) Convert the gzipped CSS to a .c array
 %.css.c: %.css.min.gz $(BIN2CEXE)
-	$(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
+	$(RUN_BIN2C)
 
-# 4) Gzip the HTML file (no minification needed)
-%.html.gz: TAG = GZIP
 %.html.gz: %.html
-	$(M)gzip -nc9 $< > $@
+	$(RUN_GZIP)
 
-# 5) Convert the gzipped HTML to a .c array
 %.html.c: %.html.gz $(BIN2CEXE)
-	$(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
+	$(RUN_BIN2C)
 
 else   # NO COMPRESSION
 
-# 2) Convert the minified CSS to a .c array
 %.css.c: %.css.min $(BIN2CEXE)
-	$(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
+	$(RUN_BIN2C)
 
-# 3) Convert the plain HTML to a .c array
 %.html.c: %.html $(BIN2CEXE)
-	$(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
+	$(RUN_BIN2C)
 endif
 
 clean::
-- 
2.49.1


From b38665f60b43154b0af213228ba21948fbf06a72 Mon Sep 17 00:00:00 2001
From: softworkz <softworkz@hotmail.com>
Date: Mon, 23 Jun 2025 14:56:04 +0200
Subject: [PATCH 3/3] fftools/resources: Update .gitignore

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 fftools/resources/.gitignore | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fftools/resources/.gitignore b/fftools/resources/.gitignore
index bda2c59a1c..cc742817b5 100644
--- a/fftools/resources/.gitignore
+++ b/fftools/resources/.gitignore
@@ -1,6 +1,5 @@
 *.html.c
 *.css.c
 *.html.gz
-*.css.gz
-*.min
-*.min.gz
+*.css.min
+*.css.min.gz
-- 
2.49.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

                 reply	other threads:[~2025-08-12 19:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250812191019.9BE8B68CD4E@ffbox0-bg.ffmpeg.org \
    --to=code@ffmpeg.org \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git