about summary refs log tree commit diff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 18 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 00e2a54..1250439 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 .POSIX:
 .SUFFIXES:
 
-all: hare-gi
+all: hare-gi .gen
 
 DESTDIR =
 PREFIX = /usr/local
@@ -38,21 +38,29 @@ MODULES_GTK4 = $(MODULES_CORE) $(MODULES_GTK_SHARED) \
 LIBS_3 != pkg-config --libs-only-l gtk+-3.0
 LIBS_4 != pkg-config --libs-only-l gtk4
 
-hare-gi:
+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/
-.PHONY: hare-gi
 
-install: hare-gi install3 install4
+.gen: hare-gi
+	./scripts/generate3
+	./scripts/generate4
+	touch .gen
+
+install: hare-gi install-gtk3 install-gtk4
 	install -Dm755 hare-gi "$(DESTDIR)$(BINDIR)"/hare-gi
 
-install3:
+install-gtk3: .gen
 	@for mod in $(MODULES_GTK3); do \
 		printf "installing %s\n" "$$mod"; \
 		mkdir -p "$(DESTDIR)$(THIRDPARTYDIR)/$$mod"; \
 		install -m644 "$(BINDINGS_DIR)/$$mod"/* "$(DESTDIR)$(THIRDPARTYDIR)/$$mod"; \
 	done
 
-install4:
+install-gtk4: .gen
 	@for mod in $(MODULES_GTK4); do \
 		printf "installing %s\n" "$$mod"; \
 		mkdir -p "$(DESTDIR)$(THIRDPARTYDIR)/$$mod"; \
@@ -93,4 +101,7 @@ demo4:
 clean:
 	rm -f hare-gi xmltree demo3 demo4 bindings/gi/*/_generate.ha
 
-.PHONY: all install3 install4 uninstall3 uninstall4 demo3 demo4 clean
+.PHONY: all clean
+.PHONY: install install-gtk3 install-gtk4
+.PHONY: uninstall uninstall3 uninstall4
+.PHONY: demo3 demo4