.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: @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: @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 HAREPATH_CMD = hare version -v | awk 'harepath { gsub(/^\t/, ""); print }; /^HAREPATH/ { harepath = 1 }' | tr '\n' ':' demo: env HAREPATH="$(BINDINGS_DIR):$$($(HAREPATH_CMD))" \ hare build $$(pkg-config --libs-only-l --static gtk+-3.0) -lbsd -o demo cmd/demo demo4: env HAREPATH="$(BINDINGS_DIR):$$($(HAREPATH_CMD))" \ 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