From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 638E54C404 for ; Mon, 23 Jun 2025 17:27:26 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 4C54A68DEBF; Mon, 23 Jun 2025 20:27:22 +0300 (EEST) Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 30F8C68DEB6 for ; Mon, 23 Jun 2025 20:27:16 +0300 (EEST) Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-748ece799bdso3097474b3a.1 for ; Mon, 23 Jun 2025 10:27:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750699634; x=1751304434; darn=ffmpeg.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :message-id:from:to:cc:subject:date:message-id:reply-to; bh=zIvj4z/pxf8NIHzW/ljEkFNJUtBS5fNt4P70B8UgNsA=; b=D9ZlDJuSNLJYBJkzSKZGbN9MOsW2HH03XWnxZvCJp0pJFEbykUugU/GxLDD/dH2zJn /QpsJuxqkJnwxIBIPND/vK3od6viF3SWNG5OSZoKumTQUxEtLM4wy//xHhHOrjnDthQ4 6/Wp0uXimwSxkYKNr8qbM9PIzwXoPCa/OWeAx4497w85US0mw/dhZMWHl+rVp6S/m9GY Ec35dUeVY0Dp4CPpdJrTtTUCswdk1tpw5qUiwZu452BGmDiag/SS1lz3UW+daQEcxMwo ZFx2MW4CLHKKPJvXg01TYHraJgtTFKqk7gHk4Nj1/eyhpIroo7Lw6VhDrG3hTFZ5ZJGY yYiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750699634; x=1751304434; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zIvj4z/pxf8NIHzW/ljEkFNJUtBS5fNt4P70B8UgNsA=; b=EuiuwOosdc7IvUaPRrHwfRZJma7RsBHriGcfuhBLjHlypSP8/NarKbM/xZmM5zCN+9 KjSBafmDhzVZgUnTVDt5+wNrIOFRZQlQg6Gxxc4hslfshTT35y6YKDmhrsdJRgvG/Pho shgI03I62do7D/+xCOAj9K4wNjnk+5tMslK6DK3TXT2Ta62yuwhKbEs/DmZsXEW8Xh/a xjlRFItJG1lYsVwEr24hJvSyKNTY7BdOsHwwgVHyIBOiDfKnDowlzXj0Hjk3TF6f4Nu3 Zy/zemagn3UZsy40GJiogNyh5PvygtoMiK3emkBuhYckAYkbA4lLWpAphlKC4fjNghMl 8QXQ== X-Gm-Message-State: AOJu0YzOK7Bst1jCEVZgjftv54lyj+WGI+DTYZLyG7LTXjkuHmgWVIgt ARcJKzQaNLoxovo8Wj0ThBPUI7mq8NARSVlzRV+ZuYjHBAc6z1WhTtky+NoWJg== X-Gm-Gg: ASbGnctc6RxPnebSNvsX8g5TJQ9Q/ldzPSgWiq+Aqo+MCBr5fcv8NUwcKYx8Cr5Y94W k/uanP7cNmXgfg/GhxRkLH8dICaYck46D5jgZNVh560yLe/3sVkfy0pewItgjXEtSa6fnOxmGHX jJ3p4W7q+Er7Bt3L7GA5xcbwY5Z9BT9c3BMMWjVWONngPj7HMwqaRuJMzS+hcte4z8bY+55ODkN Xhb9nGKkBlou1P7/oijV1wG2TiA8IQZC6q9xOGJAYiIvDKKLj6+plEoNVtB0fG0rHbbgiLHrmnN K9XCmmsiPR0NPuDEiaFAz1a7T6Rpq2Yy7voiaO6SvUhOz/I5XO123GSDbfPe/fjJvVCRPQteSNG xEv4L X-Google-Smtp-Source: AGHT+IHq5hKK/BJBTMEpM/pxITj/1i2IegvFFZdqaicqIfXE8knLUL48X9Mty+TpCSw6n9phFp1IpA== X-Received: by 2002:a05:6a00:1903:b0:746:3025:6576 with SMTP id d2e1a72fcca58-7490d7603cemr19685786b3a.14.1750699634173; Mon, 23 Jun 2025 10:27:14 -0700 (PDT) Received: from [127.0.0.1] (master.gitmailbox.com. [34.83.118.50]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7490a6494b3sm8714432b3a.125.2025.06.23.10.27.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Jun 2025 10:27:13 -0700 (PDT) Message-Id: From: ffmpegagent Date: Mon, 23 Jun 2025 17:27:05 +0000 Fcc: Sent MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH v7 0/3] ffbuild/commonmak: Fix rebuild check with implicit rule chains X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: softworkz Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: V2 == * Fix MSVC build (use the universal command pattern) V3 == * Skip dependency generation by clearing CC_DEPS instead (as suggested by Ramiro - thanks!) V4 == * Always keep .ptx files (as suggested by Timo - thanks) Tested all scenarios: * .ptx.c and .ptx.gz still get deleted (as intermediates) * repeated make shows "up-to-date" * removing a .ptx file does not cause a rebuild (it's still an intermediate, but an "intermediate to keep") * but changing a .ptx does (in case of dev/debugging) * changed .cu files always rebuild of course V5 == * First patch remains unchanged * Added second patch to clean up and consolidate the rules around compression V6 == * Rebased * Confirmed that it also resolves MSVC-CLang compilation (as reported by Kasper Michalow - thanks!) V7 == * As the log line about intermediate file deletion ("RM ....") didn't find much love, this version uses the workaround via the .SECONDARY special make target to prevent intermediate file deletion . softworkz (3): fftools/resources: Fix double-build by disabling .d file generation ffbuild/commonmak: Consolidate pattern rules for compression fftools/resources: Update .gitignore ffbuild/common.mak | 49 ++++++++++++++---------------------- fftools/Makefile | 1 + fftools/resources/.gitignore | 5 ++-- fftools/resources/Makefile | 12 ++++++--- 4 files changed, 31 insertions(+), 36 deletions(-) base-commit: e6298e0759430f64e9bd9298775de92597be8a50 Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-80%2Fsoftworkz%2Fsubmit_commonmak-v7 Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-80/softworkz/submit_commonmak-v7 Pull-Request: https://github.com/ffstaging/FFmpeg/pull/80 Range-diff vs v6: 1: a8da0e9d17 ! 1: 391217966f ffbuild/commonmak: Fix rebuild check with implicit rule chains @@ Metadata Author: softworkz ## Commit message ## - ffbuild/commonmak: Fix rebuild check with implicit rule chains - - When there's a chain of implicit rules, make treats files generated - inside that chain as intermediate files. Those intermediate files are - removed after completion of make. When make is run again, it normally - determines the need for a rebuild by comparing the timestamps of the - original source file and the final output of the chain and if still - up-to-date, it doesn't rebuild, even when the intermediate files are - not present. That makes sense of course - why would it delete them - otherwise, it would end up in builds being never up-to-date. - But this original by-the-book logic appeared to be broken and has been - worked around by adding all intermediate files to the .SECONDARY - special target, which required extra logic and issues with make clean. - - What broke the up-to-date checking is the dependency file generation. - For the .c files generated by BIN2C the compile target created a .d - file which indicated that the .ptx.o file has a dependency on the - ptx.c file. And that dependency broke the normal make behavior with - intermediate files. - - This patch compiles the BIN2C generated .c files without generating - .d files. In turn the files do not longer need to be added to the - .SECONDARY target in common.mak. - - When interested in those files for debugging, a line can be added to - the corresponding Makefile like - - .SECONDARY: %.ptx.c %.ptx.gz + fftools/resources: Fix double-build by disabling .d file generation Signed-off-by: softworkz ## ffbuild/common.mak ## -@@ ffbuild/common.mak: else - $(BIN2C) $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<) $@ $(subst .,_,$(basename $(notdir $@))) - endif - -+%.ptx.o: CCDEP = -+%.ptx.o: CC_DEPFLAGS = -+ -+ - # 1) Preprocess CSS to a minified version - %.css.min: TAG = SED - %.css.min: %.css -@@ ffbuild/common.mak: else # NO COMPRESSION - $(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@))) - endif - -+%.html.o %.css.o: CCDEP = -+%.html.o %.css.o: CC_DEPFLAGS = -+ -+ - clean:: - $(RM) $(BIN2CEXE) $(CLEANSUFFIXES:%=ffbuild/%) - @@ ffbuild/common.mak: SKIPHEADERS += $(ARCH_HEADERS:%=$(ARCH)/%) $(SKIPHEADERS-) SKIPHEADERS := $(SKIPHEADERS:%=$(SUBDIR)%) HOBJS = $(filter-out $(SKIPHEADERS:.h=.h.o),$(ALLHEADERS:.h=.h.o)) @@ ffbuild/common.mak: SKIPHEADERS += $(ARCH_HEADERS:%=$(ARCH)/%) $(SKIPHEADERS-) $(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=) - +- ++.SECONDARY: $(HOBJS:.o=.c) $(PTXOBJS:.o=.c) $(PTXOBJS:.o=.gz) $(PTXOBJS:.o=) alltools: $(TOOLS) + $(HOSTOBJS): %.o: %.c +@@ ffbuild/common.mak: $(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 + + ## fftools/Makefile ## +@@ fftools/Makefile: OBJS-ffmpeg += \ + fftools/textformat/tw_buffer.o \ + fftools/textformat/tw_stdout.o \ + $(OBJS-resman) \ ++ $(RESOBJS) \ + + OBJS-ffprobe += \ + fftools/textformat/avtextformat.o \ + + ## fftools/resources/Makefile ## +@@ fftools/resources/Makefile: 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: 1781c5fc16 ! 2: 17b0af91ec ffbuild/commonmak: Consolidate pattern rules for compression @@ ffbuild/common.mak: $(BIN2CEXE): ffbuild/bin2c_host.o + $(RUN_BIN2C) endif - %.ptx.o: CCDEP = - %.ptx.o: CC_DEPFLAGS = - - -# 1) Preprocess CSS to a minified version -%.css.min: TAG = SED %.css.min: %.css @@ ffbuild/common.mak: $(BIN2CEXE): ffbuild/bin2c_host.o + $(RUN_BIN2C) endif - %.html.o %.css.o: CCDEP = + clean:: -: ---------- > 3: dde90b288f fftools/resources: Update .gitignore -- ffmpeg-codebot _______________________________________________ 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".