On Tue, May 27, 2025 at 4:11 AM softworkz .
<softworkz-at-hotmail....@ffmpeg.org> wrote:
> > -----Original Message-----
> > From: ffmpeg-devel <ffmpeg-devel-boun...@ffmpeg.org> On Behalf Of Ramiro 
> > Polla
> > Sent: Dienstag, 27. Mai 2025 03:33
> > To: ffmpeg-devel@ffmpeg.org
> > Subject: [FFmpeg-devel] [PATCH 4/5] ffbuild/common.mak: clean up and move
> > fftools/resources-specific code its Makefile
> >
> > - Intermediate files are no longer removed;
>
> Why? That's the way it's meant to work and it's working fine (will push 
> tomorrow)

Deleting intermediate files prints an "rm" message at the end of the
build. It also deletes files that we might want to inspect later.

> > - A .res suffix has been added to resource files, so that there's no
> >   need to add new rules for each new filetype;
>
> I don't want this. I want the editor to be aware of the file type when 
> opening.

Fair enough. New patch attached.
From 9fb4a90735eb1e5fc223128376b98bc7e3a8b597 Mon Sep 17 00:00:00 2001
From: Ramiro Polla <ramiro.po...@gmail.com>
Date: Tue, 27 May 2025 00:13:47 +0200
Subject: [PATCH v2 4/5] ffbuild/common.mak: clean up and move
 fftools/resources-specific code its Makefile

- Intermediate files are no longer removed;
- Superfluous comments have been removed;
- Targets depending on CONFIG_RESOURCE_COMPRESSION have been
  deduplicated.
---
 ffbuild/common.mak           | 45 ++----------------------------------
 fftools/resources/.gitignore |  5 ++--
 fftools/resources/Makefile   | 32 +++++++++++++++++++++----
 fftools/resources/resman.c   |  6 ++---
 4 files changed, 35 insertions(+), 53 deletions(-)

diff --git a/ffbuild/common.mak b/ffbuild/common.mak
index ddf48923ea..7060ba0bb0 100644
--- a/ffbuild/common.mak
+++ b/ffbuild/common.mak
@@ -139,46 +139,6 @@ else
 	$(BIN2C) $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<) $@ $(subst .,_,$(basename $(notdir $@)))
 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/ $$//' \
-	> $@
-
-ifdef CONFIG_RESOURCE_COMPRESSION
-
-# 2) Gzip the minified CSS
-%.css.min.gz: TAG = GZIP
-%.css.min.gz: %.css.min
-	$(M)gzip -nc9 $< > $@
-
-# 3) Convert the gzipped CSS to a .c array
-%.css.c: %.css.min.gz $(BIN2CEXE)
-	$(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
-
-# 4) Gzip the HTML file (no minification needed)
-%.html.gz: TAG = GZIP
-%.html.gz: %.html
-	$(M)gzip -nc9 $< > $@
-
-# 5) Convert the gzipped HTML to a .c array
-%.html.c: %.html.gz $(BIN2CEXE)
-	$(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
-
-else   # NO COMPRESSION
-
-# 2) Convert the minified CSS to a .c array
-%.css.c: %.css.min $(BIN2CEXE)
-	$(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
-
-# 3) Convert the plain HTML to a .c array
-%.html.c: %.html $(BIN2CEXE)
-	$(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
-endif
-
 clean::
 	$(RM) $(BIN2CEXE) $(CLEANSUFFIXES:%=ffbuild/%)
 
@@ -229,10 +189,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)
 
@@ -252,7 +211,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 *$(DEFAULT_X86ASMD).asm *~ *.ilk *.pdb
 LIBSUFFIXES       = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
 
 define RULES
diff --git a/fftools/resources/.gitignore b/fftools/resources/.gitignore
index 5f496535a6..8fc0e8b407 100644
--- a/fftools/resources/.gitignore
+++ b/fftools/resources/.gitignore
@@ -1,4 +1,5 @@
 *.html.c
-*.css.c
+*.min.c
 *.html.gz
-*.css.gz
+*.min.gz
+*.min
diff --git a/fftools/resources/Makefile b/fftools/resources/Makefile
index 8579a52678..fe82d02594 100644
--- a/fftools/resources/Makefile
+++ b/fftools/resources/Makefile
@@ -1,13 +1,35 @@
+RES_CLEANSUFFIXES = *.o *.css.min.c *.html.c *.d *.gz *.min
+
 clean::
-	$(RM) $(CLEANSUFFIXES:%=fftools/resources/%)
+	$(RM) $(RES_CLEANSUFFIXES:%=fftools/resources/%)
 
 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
+RESOURCEOBJS += fftools/resources/graph.css.min.o
+RESOURCEOBJS += fftools/resources/graph.html.o
 
 OBJS-resman +=                     \
     fftools/resources/resman.o     \
-    fftools/resources/graph.html.o \
-    fftools/resources/graph.css.o  \
+    $(RESOURCEOBJS)
+
+%.css.min: TAG = SED
+%.css.min: %.css
+	$(M)sed 's!/\\*.*\\*/!!g' $< \
+	| tr '\n' ' ' \
+	| tr -s ' ' \
+	| sed 's/^ //; s/ $$//' \
+	> $@
+
+ifdef CONFIG_RESOURCE_COMPRESSION
+RES_GZ = .gz
+endif
+
+$(RESOURCEOBJS:.o=.gz): TAG = GZIP
+$(RESOURCEOBJS:.o=.gz): %.gz: %
+	$(M)gzip -nc9 $< > $@
+
+$(RESOURCEOBJS:.o=.c): %.c: %$(RES_GZ) $(BIN2CEXE)
+	$(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
+
+.SECONDARY: $(RESOURCEOBJS:.o=) $(RESOURCEOBJS:.o=.c) $(RESOURCEOBJS:.o=.gz)
diff --git a/fftools/resources/resman.c b/fftools/resources/resman.c
index a9e21626fa..6c131dd4e7 100644
--- a/fftools/resources/resman.c
+++ b/fftools/resources/resman.c
@@ -41,11 +41,11 @@
 extern const unsigned char ff_graph_html_data[];
 extern const unsigned int ff_graph_html_len;
 
-extern const unsigned char ff_graph_css_data[];
-extern const unsigned ff_graph_css_len;
+extern const unsigned char ff_graph_css_min_data[];
+extern const unsigned ff_graph_css_min_len;
 
 static const FFResourceDefinition resource_definitions[] = {
-    [FF_RESOURCE_GRAPH_CSS]   = { FF_RESOURCE_GRAPH_CSS,   "graph.css",   &ff_graph_css_data[0],   &ff_graph_css_len   },
+    [FF_RESOURCE_GRAPH_CSS]   = { FF_RESOURCE_GRAPH_CSS,   "graph.css",   &ff_graph_css_min_data[0], &ff_graph_css_min_len },
     [FF_RESOURCE_GRAPH_HTML]  = { FF_RESOURCE_GRAPH_HTML,  "graph.html",  &ff_graph_html_data[0],  &ff_graph_html_len  },
 };
 
-- 
2.39.5

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

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

Reply via email to