]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
build: update Makefile and meson.build 4574/head
authorAlessio Attilio <alessio.attilio@engineer.com>
Wed, 7 Jan 2026 17:12:05 +0000 (18:12 +0100)
committerAlessio Attilio <alessio.attilio@engineer.com>
Wed, 7 Jan 2026 17:12:05 +0000 (18:12 +0100)
Update Makefile to use 'build' directory and add helper targets. Fix syntax error in meson.build.

Signed-off-by: Alessio Attilio <alessio.attilio@engineer.com>
Makefile
meson.build

index 212aa3bee7dc9e5b2867698e579809dba35af578..8b68458f62d7512d69ad834c7faff5a35557c9b6 100644 (file)
--- 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
index 40973279e79525ed7f8389352137101499652883..b8185c2cb2b7c2b2fac8f552b4590e09c80c2c0d 100644 (file)
@@ -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')