Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Ramiro Polla <ramiro.polla@gmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 4/5] ffbuild/common.mak: clean up and move fftools/resources-specific code its Makefile
Date: Tue, 27 May 2025 05:29:10 +0200
Message-ID: <CALweWgCxzyb-LntKEqvirXEjsTYcLAxXg5S1Qta4zt-57Krq1Q@mail.gmail.com> (raw)
In-Reply-To: <DM8P223MB036524AC6A1C088153C4ADAFBA64A@DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM>

[-- Attachment #1: Type: text/plain, Size: 942 bytes --]

On Tue, May 27, 2025 at 4:11 AM softworkz .
<softworkz-at-hotmail.com@ffmpeg.org> wrote:
> > -----Original Message-----
> > From: ffmpeg-devel <ffmpeg-devel-bounces@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.

[-- Attachment #2: v2-0004-ffbuild-common.mak-clean-up-and-move-fftools-reso.patch --]
[-- Type: text/x-patch, Size: 5785 bytes --]

From 9fb4a90735eb1e5fc223128376b98bc7e3a8b597 Mon Sep 17 00:00:00 2001
From: Ramiro Polla <ramiro.polla@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


[-- Attachment #3: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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-05-27  3:29 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-27  1:33 [FFmpeg-devel] [PATCH 1/5] configure: remove build-time check for gzip support in zlib Ramiro Polla
2025-05-27  1:33 ` [FFmpeg-devel] [PATCH 2/5] configure: move embedded resource checks to dependency tracker Ramiro Polla
2025-05-27  1:33 ` [FFmpeg-devel] [PATCH 3/5] configure: improve gzip check Ramiro Polla
2025-05-27  6:54   ` Jacob Lifshay
2025-05-27 16:12     ` Ramiro Polla
2025-05-27 19:45       ` Jacob Lifshay
2025-05-27  1:33 ` [FFmpeg-devel] [PATCH 4/5] ffbuild/common.mak: clean up and move fftools/resources-specific code its Makefile Ramiro Polla
2025-05-27  1:48   ` softworkz .
2025-05-27  2:04     ` Ramiro Polla
2025-05-27  2:18       ` softworkz .
2025-05-27  1:55   ` softworkz .
2025-05-27  3:29     ` Ramiro Polla [this message]
2025-05-27  4:02       ` softworkz .
2025-05-27 12:35         ` Ramiro Polla
2025-05-27 19:20           ` softworkz .
2025-05-27 19:59             ` Ramiro Polla
2025-05-27 20:13               ` softworkz .
2025-05-30 11:00                 ` Ramiro Polla
2025-05-27  1:33 ` [FFmpeg-devel] [PATCH 5/5] fftools/Makefile: clean files from fftools/{graph, textformat}/ Ramiro Polla
2025-06-01 21:30   ` Ramiro Polla
2025-06-01 21:46     ` softworkz .
2025-06-01 21:58       ` softworkz .
2025-05-27  1:43 ` [FFmpeg-devel] [PATCH 1/5] configure: remove build-time check for gzip support in zlib softworkz .
2025-05-27  1:52   ` Ramiro Polla
2025-05-27 13:18 ` Timo Rothenpieler
2025-05-27 17:55   ` Ramiro Polla
2025-05-30 11:10     ` Ramiro Polla
2025-05-30 18:18       ` Jacob Lifshay
2025-06-02 23:22         ` Ramiro Polla
2025-06-02 23:25           ` softworkz .
2025-06-02 23:31             ` softworkz .
2025-06-03  0:19             ` Ramiro Polla
2025-06-03  0:46               ` softworkz .

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=CALweWgCxzyb-LntKEqvirXEjsTYcLAxXg5S1Qta4zt-57Krq1Q@mail.gmail.com \
    --to=ramiro.polla@gmail.com \
    --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