aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile23
1 files changed, 23 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index ebebf03..2d3c756 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,24 @@
+MESON := $(shell which meson 2>&1)
+
+ifneq ($(MESON),)
+
+HOST := $(shell hostname -s)
+BDIR := build-meson-$(HOST)
+
+build: $(BDIR)/build.ninja
+ ninja-build -C $(BDIR)
+
+install: build
+ ninja-build -C $(BDIR) install
+
+clean:
+ rm -rf $(BDIR)
+
+$(BDIR)/build.ninja:
+ $(MESON) $(BDIR)
+
+else
+
CC ?= gcc
CFLAGS ?= -Os -g -std=c99
CFLAGS += -Wall
@@ -24,3 +45,5 @@ clean:
drminfo: drminfo.o drmtools.o
drmtest: drmtest.o drmtools.o render.o image.o
gtktest: gtktest.o render.o image.o
+
+endif