From 4a5aa19d73b90ce1ad6f2e354b69f5ae7e8e2e50 Mon Sep 17 00:00:00 2001 From: Alessio Attilio Date: Wed, 7 Jan 2026 18:12:05 +0100 Subject: [PATCH] build: update Makefile and meson.build Update Makefile to use 'build' directory and add helper targets. Fix syntax error in meson.build. Signed-off-by: Alessio Attilio --- Makefile | 43 ++++++++++++++++++++++++++++++++++--------- meson.build | 3 ++- 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 212aa3bee..8b68458f6 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,43 @@ # SPDX-License-Identifier: LGPL-2.1+ -.PHONY: all +MESON ?= meson +NINJA ?= ninja + +BUILDDIR := build +DISTDIR := $(BUILDDIR)/meson-dist + +.PHONY: all meson dist install clean rebuild help + +help: + @echo "Available commands:" + @echo " all - Build the project" + @echo " meson - Configure or reconfigure the project with Meson" + @echo " dist - Create the distribution package" + @echo " install - Install the project" + @echo " clean - Remove generated files" + @echo " rebuild - Clean and rebuild everything" + @echo " help - Show this message" + all: meson - ninja -C build + $(NINJA) -C $(BUILDDIR) -.PHONY: meson meson: - [ -d build ] || meson setup build/ + @if [ ! -d $(BUILDDIR) ]; then \ + $(MESON) setup $(BUILDDIR); \ + else \ + $(MESON) setup --reconfigure $(BUILDDIR); \ + fi -.PHONY: dist dist: meson - meson dist -C build/ --formats=gztar - cp build/meson-dist/*.tar.gz . + $(MESON) dist -C $(BUILDDIR) --formats=gztar + cp $(DISTDIR)/*.tar.gz . -.PHONY: install install: - DESTDIR=$(DESTDIR) ninja -C build install + DESTDIR=$(DESTDIR) $(NINJA) -C $(BUILDDIR) install + +clean: + rm -rf $(BUILDDIR) *.tar.gz + +rebuild: + $(MAKE) clean + $(MAKE) all \ No newline at end of file diff --git a/meson.build b/meson.build index 40973279e..b8185c2cb 100644 --- a/meson.build +++ b/meson.build @@ -736,7 +736,8 @@ if cc.sizeof('struct mount_attr', prefix: decl_headers, args: '-D_GNU_SOURCE') > found_types += 'struct mount_attr (sys/mount.h)' else srcconf.set10('HAVE_' + 'struct mount_attr'.underscorify().to_upper(), false) - missing_types += 'struct mount_attr (sys/mount.h)' endif + missing_types += 'struct mount_attr (sys/mount.h)' +endif ## Check if sys/mount.h defines the fsconfig commands if cc.has_header_symbol('sys/mount.h','FSCONFIG_SET_FLAG') -- 2.47.3