about summary refs log tree commit diff
path: root/Makefile
blob: 0038792438fbf317f882d04d523d796516519484 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
.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

demo:
	env HAREPATH="$(BINDINGS_DIR):$$(hare version -v | grep HAREPATH | cut -f2-)" \
		hare build $$(pkg-config --libs-only-l --static gtk+-3.0) -lbsd -o demo cmd/demo

demo4:
	env HAREPATH="$(BINDINGS_DIR):$$(hare version -v | grep HAREPATH | cut -f2-)" \
		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