.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_ENV_CMD = hare version -vv | grep '^HAREPATH' # hare version -vv returns the value of HAREPATH in form # HAREPATH= # # Using eval on that line will set the HAREPATH variable in the environment to # the unquoted value, which makes it easy to add the bindings directory to the # path demo: eval "$$($(HAREPATH_ENV_CMD))" && env HAREPATH="$(BINDINGS_DIR):$$HAREPATH" \ hare build $$(pkg-config --libs-only-l gtk+-3.0) -o demo cmd/demo demo4: eval "$$($(HAREPATH_ENV_CMD))" && env HAREPATH="$(BINDINGS_DIR):$$HAREPATH" \ hare build $$(pkg-config --libs-only-l gtk4) -o demo4 cmd/demo4 clean: rm -f hare-gi xmltree demo demo4 .PHONY: all install install4 uninstall uninstall4 demo demo4 clean