[vlc-commits] [Git][videolan/vlc][master] 3 commits: Makefile.am: move CLEANFILES= to top Makefile

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Fri Feb 28 13:24:20 UTC 2025



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
77892a3f by Alexandre Janniaux at 2025-02-28T12:46:32+00:00
Makefile.am: move CLEANFILES= to top Makefile

It's easier to setup CLEANFILES to $(NULL) at the top makefile and then
always append to it whenever needed.

- - - - -
3dca9e2e by Alexandre Janniaux at 2025-02-28T12:46:32+00:00
modules: Makefile.am: clean rust artifacts

This commit signal the mostlyclean and other dependant targets that it
should clean the targets generated by cargo.

We use a separate target name and add the dependency to
mostlyclean-local so that we can still extend the known automake target.

We also don't use CLEANFILES so that dependencies files are also removed
when using `make mostlyclean-local-rust` to avoid a corrupted tree where
the dependencies would not be removed but the target files they
reference would not exist anymore.

- - - - -
09c4e873 by Alexandre Janniaux at 2025-02-28T12:46:32+00:00
rust: Makefile.am: remove superfluous parenthesis

- - - - -


4 changed files:

- modules/Makefile.am
- modules/common.am
- modules/gui/qt/Makefile.am
- src/rust/Makefile.am


Changes:

=====================================
modules/Makefile.am
=====================================
@@ -6,7 +6,7 @@ noinst_HEADERS =
 check_PROGRAMS =
 pkglibexec_PROGRAMS =
 EXTRA_DIST =
-
+CLEANFILES =
 
 SUBDIRS = .
 TESTS =
@@ -43,6 +43,18 @@ CARGO_DEPS = ${CARGO_PLUGINS:%_plugin.la=${top_builddir}/modules/.libs/%.d}
 
 -include $(CARGO_DEPS)
 
+# Clean the targets generated by cargo.
+mostlyclean-local: mostlyclean-local-rust
+.PHONY: mostlyclean-local-rust
+# We don't use CLEANFILES here so that mostlyclean-local-rust
+# works correctly when called directly. Otherwise, dependencies
+# are leading to target being referenced but they cannot be built.
+mostlyclean-local-rust:
+	rm -rf $(CARGO_DEPS) ${CARGO_PLUGINS:%_plugin.la=%.la}
+	$(CARGO) clean \
+		--manifest-path "${srcdir}/Cargo.toml" \
+		--target "@RUST_TARGET@" \
+		--target-dir "target-rust"
 endif
 
 include common.am


=====================================
modules/common.am
=====================================
@@ -10,7 +10,7 @@ AUTOMAKE_OPTIONS = subdir-objects
 NULL =
 pluginsdir = $(pkglibdir)/plugins
 BUILT_SOURCES =
-CLEANFILES = $(BUILT_SOURCES)
+CLEANFILES += $(BUILT_SOURCES)
 
 LTLIBVLCCORE = $(top_builddir)/src/libvlccore.la
 


=====================================
modules/gui/qt/Makefile.am
=====================================
@@ -11,6 +11,8 @@
 # For each qml and js resource
 #   - Add it to ..._QML
 
+CLEANFILES =
+
 include ../../common.am
 guidir = $(pluginsdir)/gui
 gui_LTLIBRARIES =


=====================================
src/rust/Makefile.am
=====================================
@@ -7,8 +7,8 @@ vlcrs-core.cargo:
 vlcrs-macros.cargo:
 vlcrs-messages.cargo:
 vlcrs-utils.cargo:
-	(cd $(top_srcdir)/src/rust/$(@:.cargo=) && env top_builddir="${abs_top_builddir}" \
-         $(CARGO) build --target=$(RUST_TARGET))
+	cd $(top_srcdir)/src/rust/$(@:.cargo=) && env top_builddir="${abs_top_builddir}" \
+         $(CARGO) build --target=$(RUST_TARGET)
 
 if HAVE_RUST
 TESTS += \



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e25ec4e25be1f2620ec031d2ef7bf5a09809235d...09c4e873cf7bb1dc519ded0cb6cdb582d73d6b69

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e25ec4e25be1f2620ec031d2ef7bf5a09809235d...09c4e873cf7bb1dc519ded0cb6cdb582d73d6b69
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list