summaryrefslogtreecommitdiff
path: root/makefile
blob: b5ad669dc43f7e4bc6dbd1e8de7ba20671169d90 (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
target:=pui
objects:=main.o pui.o xdg-shell.o
protocols:=/usr/share/wayland-protocols
wl_headers:=xdg-shell.h

CFLAGS:=-O3 -Wall -Wextra -Werror -pedantic
LDFLAGS:=-O3 -s -lwayland-client -lrt

all: $(target) sample.pui

sample.pui: convert sample.bmp sample.ini
	./$^ > $@

convert: convert.c
	$(CC) $(CFLAGS) -s $< -o $@

$(target): $(objects)
	$(CC) $(LDFLAGS) $^ -o $@

%.o: %.c *.h $(wl_headers)
	$(CC) $(CFLAGS) -c $< -o $@

%.c: $(protocols)/*/*/%.xml
	wayland-scanner private-code $< $@

%.h: $(protocols)/*/*/%.xml
	wayland-scanner client-header $< $@

clean:
	rm $(target) $(objects) $(wl_headers) convert sample.pui

.PRECIOUS: $(wl_headers)