-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
100 lines (79 loc) · 3.12 KB
/
Makefile
File metadata and controls
100 lines (79 loc) · 3.12 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
CC ?= cc
TARGET := windows
WAYLAND_SCANNER := $(shell pkg-config --variable=wayland_scanner wayland-scanner)
WAYLAND_PROTOCOLS := $(shell pkg-config --variable=pkgdatadir wayland-protocols)
WAYLAND_HEADER := \
fractional-scale-v1-protocol.h \
viewporter-protocol.h \
xdg-shell-protocol.h \
ext-foreign-toplevel-list-v1-protocol.h \
ext-image-capture-source-v1-protocol.h \
ext-image-copy-capture-v1-protocol.h
WAYLAND_INTERFACE := \
fractional-scale-v1-protocol.c \
viewporter-protocol.c \
xdg-shell-protocol.c \
ext-foreign-toplevel-list-v1-protocol.c \
ext-image-capture-source-v1-protocol.c \
ext-image-copy-capture-v1-protocol.c
SRCS := $(wildcard *.c)
OBJS := $(SRCS:.c=.o)
DEPS := $(SRCS:.c=.d)
CFLAGS += \
$(shell pkg-config --cflags wayland-client) \
$(shell pkg-config --cflags xkbcommon) \
$(shell pkg-config --cflags cairo)
LDLIBS += \
$(shell pkg-config --libs wayland-client) \
$(shell pkg-config --libs xkbcommon) \
$(shell pkg-config --libs cairo)
fractional-scale-v1-protocol.h: \
$(WAYLAND_PROTOCOLS)/staging/fractional-scale/fractional-scale-v1.xml
$(WAYLAND_SCANNER) client-header $< $@
fractional-scale-v1-protocol.c: \
$(WAYLAND_PROTOCOLS)/staging/fractional-scale/fractional-scale-v1.xml
$(WAYLAND_SCANNER) private-code $< $@
viewporter-protocol.h: \
$(WAYLAND_PROTOCOLS)/stable/viewporter/viewporter.xml
$(WAYLAND_SCANNER) client-header $< $@
viewporter-protocol.c: \
$(WAYLAND_PROTOCOLS)/stable/viewporter/viewporter.xml
$(WAYLAND_SCANNER) private-code $< $@
xdg-shell-protocol.h: \
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml
$(WAYLAND_SCANNER) client-header $< $@
xdg-shell-protocol.c: \
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml
$(WAYLAND_SCANNER) private-code $< $@
ext-foreign-toplevel-list-v1-protocol.h: \
$(WAYLAND_PROTOCOLS)/staging/ext-foreign-toplevel-list/ext-foreign-toplevel-list-v1.xml
$(WAYLAND_SCANNER) client-header $< $@
ext-foreign-toplevel-list-v1-protocol.c: \
$(WAYLAND_PROTOCOLS)/staging/ext-foreign-toplevel-list/ext-foreign-toplevel-list-v1.xml
$(WAYLAND_SCANNER) private-code $< $@
ext-image-capture-source-v1-protocol.h: \
$(WAYLAND_PROTOCOLS)/staging/ext-image-capture-source/ext-image-capture-source-v1.xml
$(WAYLAND_SCANNER) client-header $< $@
ext-image-capture-source-v1-protocol.c: \
$(WAYLAND_PROTOCOLS)/staging/ext-image-capture-source/ext-image-capture-source-v1.xml
$(WAYLAND_SCANNER) private-code $< $@
ext-image-copy-capture-v1-protocol.h: \
$(WAYLAND_PROTOCOLS)/staging/ext-image-copy-capture/ext-image-copy-capture-v1.xml
$(WAYLAND_SCANNER) client-header $< $@
ext-image-copy-capture-v1-protocol.c: \
$(WAYLAND_PROTOCOLS)/staging/ext-image-copy-capture/ext-image-copy-capture-v1.xml
$(WAYLAND_SCANNER) private-code $< $@
$(TARGET): $(OBJS)
$(CC) -o $@ $(OBJS) $(LDLIBS) $(LDFLAGS)
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
%.d: %.c $(WAYLAND_HEADER) $(WAYLAND_INTERFACE)
@set -e; rm -f $@; \
$(CC) -MM $(CFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
-include $(DEPS)
.PHONY: clean
clean:
rm -f $(OBJS) $(DEPS) $(TARGET) $(WAYLAND_HEADER) $(WAYLAND_INTERFACE)
.DEFAULT_GOAL := $(TARGET)