.POSIX: .SUFFIXES: all: hare-gi .gen DESTDIR = PREFIX = /usr/local BINDIR = $(PREFIX)/bin SRCDIR = $(PREFIX)/src HARESRCDIR = $(SRCDIR)/hare THIRDPARTYDIR = $(HARESRCDIR)/third-party MODULES_CORE = \ gi/libc \ gi/glib \ gi/gobject \ gi/gio \ gi/gmodule MODULES_GTK_SHARED = \ gi/atk \ gi/gdkpixbuf \ gi/freetype \ gi/harfbuzz \ gi/cairo \ gi/pango \ gi/xlib MODULES_GTK3 = $(MODULES_CORE) $(MODULES_GTK_SHARED) \ gi/gdk \ gi/gtk MODULES_GTK4 = $(MODULES_CORE) $(MODULES_GTK_SHARED) \ gi/gdk4 \ gi/gtk4 \ gi/pangocairo \ gi/graphene \ gi/gsk LIBS_3 != pkg-config --libs-only-l gtk+-3.0 LIBS_4 != pkg-config --libs-only-l gtk4 HARE_GI_SRC != find cmd/hare-gi/ -name '*.ha' GIR_SRC != find gir/ -name '*.ha' FORMAT_FASTXML_SRC != find format/fastxml/ -name '*.ha' hare-gi: $(HARE_GI_SRC) $(GIR_SRC) $(FORMAT_FASTXML_SRC) hare build -o $@ cmd/hare-gi/ .gen: hare-gi ./scripts/generate3 ./scripts/generate4 touch .gen install: hare-gi install-gtk3 install-gtk4 install -Dm755 hare-gi "$(DESTDIR)$(BINDIR)"/hare-gi install-gtk3: .gen @for mod in $(MODULES_GTK3); do \ printf "installing %s\n" "$$mod"; \ mkdir -p "$(DESTDIR)$(THIRDPARTYDIR)/$$mod"; \ install -m644 "$$mod"/* "$(DESTDIR)$(THIRDPARTYDIR)/$$mod"; \ done install-gtk4: .gen @for mod in $(MODULES_GTK4); do \ printf "installing %s\n" "$$mod"; \ mkdir -p "$(DESTDIR)$(THIRDPARTYDIR)/$$mod"; \ install -m644 "$$mod"/* "$(DESTDIR)$(THIRDPARTYDIR)/$$mod"; \ done uninstall: uninstall3 uninstall4 uninstall3: @for mod in $(MODULES_GTK3); do \ printf "uninstalling %s\n" "$$mod"; \ rm -r "$(DESTDIR)$(THIRDPARTYDIR)/$$mod"; \ done uninstall4: @for mod in $(MODULES_GTK4); do \ printf "uninstalling %s\n" "$$mod"; \ rm -r "$(DESTDIR)$(THIRDPARTYDIR)/$$mod"; \ done demo3: .gen hare build $(LIBS_3) -o demo3 cmd/demo3 demo4: .gen hare build $(LIBS_4) -o demo4 cmd/demo4 clean: rm -f hare-gi xmltree demo3 demo4 gi/*/_generate.ha .PHONY: all clean .PHONY: install install-gtk3 install-gtk4 .PHONY: uninstall uninstall3 uninstall4 .PHONY: demo3 demo4