.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 = \ gi/gdk \ gi/gtk MODULES_GTK4 = \ gi/gdk4 \ gi/gtk4 \ gi/pangocairo \ gi/graphene \ gi/gsk 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/generate-gtk3 ./scripts/generate-gtk4 touch .gen install: hare-gi install-core install-gtk-shared install-gtk3 install-gtk4 install -Dm755 hare-gi "$(DESTDIR)$(BINDIR)"/hare-gi install-core: .gen @./scripts/install-modules "$(DESTDIR)$(THIRDPARTYDIR)" $(MODULES_CORE) install-gtk-shared: .gen @./scripts/install-modules "$(DESTDIR)$(THIRDPARTYDIR)" $(MODULES_GTK_SHARED) install-gtk3: .gen @./scripts/install-modules "$(DESTDIR)$(THIRDPARTYDIR)" $(MODULES_GTK3) install-gtk4: .gen @./scripts/install-modules "$(DESTDIR)$(THIRDPARTYDIR)" $(MODULES_GTK4) uninstall: uninstall-core uninstall-gtk-shared uninstall-gtk3 uninstall-gtk4 uninstall-core: @./scripts/uninstall-modules "$(DESTDIR)$(THIRDPARTYDIR)" $(MODULES_CORE) uninstall-gtk-shared: @./scripts/uninstall-modules "$(DESTDIR)$(THIRDPARTYDIR)" $(MODULES_GTK_SHARED) uninstall-gtk3: @./scripts/uninstall-modules "$(DESTDIR)$(THIRDPARTYDIR)" $(MODULES_GTK3) uninstall-gtk4: @./scripts/uninstall-modules "$(DESTDIR)$(THIRDPARTYDIR)" $(MODULES_GTK4) demo-gtk3: .gen hare build $(shell pkg-config --libs-only-l gtk+-3.0) -o demo-gtk3 cmd/demo-gtk3 demo-gtk4: .gen hare build $(shell pkg-config --libs-only-l gtk4) -o demo-gtk4 cmd/demo-gtk4 clean: rm -f hare-gi xmltree demo-gtk3 demo-gtk4 gi/*/_generate.ha .PHONY: all clean .PHONY: install install-core install-gtk-shared install-gtk3 install-gtk4 .PHONY: uninstall uninstall-core uninstall-gtk-shared uninstall-gtk3 uninstall-gtk4 .PHONY: demo-gtk3 demo-gtk4