about summary refs log tree commit diff
path: root/Makefile
diff options
context:
space:
mode:
authorAlexey Yerin <yyp@disroot.org>2023-05-28 14:10:05 +0300
committerAlexey Yerin <yyp@disroot.org>2023-05-28 14:15:22 +0300
commit16e730f540acfe6a0015464c81831cdfacaf107b (patch)
treea2aa04bf788dc16977fc6cda2ed874938c3c13c5 /Makefile
Initial commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile55
1 files changed, 55 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..2b41877
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,55 @@
+.POSIX:
+.SUFFIXES:
+
+BINDINGS_DIR = bindings
+CORE_MODULES = glib gobject gio gmodule atk gdkpixbuf freetype harfbuzz cairo pango xlib types/libc
+MODULES3 = $(CORE_MODULES) gdk gtk
+MODULES4 = $(CORE_MODULES) gdk4 gtk4 pangocairo graphene gsk
+
+DESTDIR =
+PREFIX = /usr/local
+SRCDIR = $(PREFIX)/src
+HARESRCDIR = $(SRCDIR)/hare
+THIRDPARTYDIR = $(HARESRCDIR)/third-party
+
+all:
+	@true
+
+install: install-core
+	@for mod in $(MODULES3); do \
+		printf "installing %s\n" "$$mod"; \
+		mkdir -p "$(DESTDIR)$(THIRDPARTYDIR)/$$mod"; \
+		install -m644 "$(BINDINGS_DIR)/$$mod"/* "$(DESTDIR)$(THIRDPARTYDIR)/$$mod"; \
+	done
+
+install4: install-core
+	@for mod in $(MODULES4); do \
+		printf "installing %s\n" "$$mod"; \
+		mkdir -p "$(DESTDIR)$(THIRDPARTYDIR)/$$mod"; \
+		install -m644 "$(BINDINGS_DIR)/$$mod"/* "$(DESTDIR)$(THIRDPARTYDIR)/$$mod"; \
+	done
+
+uninstall:
+	@for mod in $(MODULES3); do \
+		printf "uninstalling %s\n" "$$mod"; \
+		rm -r "$(DESTDIR)$(THIRDPARTYDIR)/$$mod"; \
+	done
+
+uninstall4:
+	@for mod in $(MODULES4); do \
+		printf "uninstalling %s\n" "$$mod"; \
+		rm -r "$(DESTDIR)$(THIRDPARTYDIR)/$$mod"; \
+	done
+
+demo:
+	env HAREPATH="$(BINDINGS_DIR):$$(hare version -v | grep HAREPATH | cut -f2-)" \
+		hare build $$(pkg-config --libs-only-l --static gtk+-3.0) -lbsd -o demo cmd/demo
+
+demo4:
+	env HAREPATH="$(BINDINGS_DIR):$$(hare version -v | grep HAREPATH | cut -f2-)" \
+		hare build $$(pkg-config --libs-only-l --static gtk4) -lepoxy -lXi -lxkbcommon -lwayland-client -lwayland-egl -lXfixes -lXcursor -lXdamage -lXrandr -lXinerama -lcairo-script-interpreter -lbsd -o demo4 cmd/demo4
+
+clean:
+	rm -f hare-gi xmltree demo demo4
+
+.PHONY: all install install4 uninstall uninstall4 demo demo4 clean