2022-09-09 22:12:06 +02:00
|
|
|
|
# Choose a dedicated build directory as ‘make clean’ will remove it entirely
|
2022-09-06 23:36:03 +02:00
|
|
|
|
BUILD = build
|
2022-09-09 22:12:06 +02:00
|
|
|
|
$(shell mkdir -p $(BUILD))
|
2022-09-06 23:36:03 +02:00
|
|
|
|
|
|
|
|
|
CFLAGS += -Wall
|
2022-09-07 16:28:43 +02:00
|
|
|
|
|
|
|
|
|
CFLAGS += $(shell pkg-config --cflags pangocairo)
|
|
|
|
|
LDLIBS += $(shell pkg-config --libs pangocairo)
|
|
|
|
|
|
2022-09-07 20:10:19 +02:00
|
|
|
|
CFLAGS += $(shell pkg-config --cflags cairo)
|
|
|
|
|
LDLIBS += $(shell pkg-config --libs cairo)
|
2022-09-07 16:28:43 +02:00
|
|
|
|
|
2022-09-07 20:10:19 +02:00
|
|
|
|
CFLAGS += $(shell pkg-config --cflags wayland-client)
|
|
|
|
|
LDLIBS += $(shell pkg-config --libs wayland-client)
|
2022-09-07 16:28:43 +02:00
|
|
|
|
|
|
|
|
|
LDLIBS += -lrt
|
2022-09-06 23:36:03 +02:00
|
|
|
|
|
|
|
|
|
.PHONY: all clean
|
|
|
|
|
|
|
|
|
|
all: build/wl-overlay
|
|
|
|
|
|
|
|
|
|
clean:
|
2022-09-09 22:12:06 +02:00
|
|
|
|
rm -rf $(BUILD)
|
2022-09-06 23:36:03 +02:00
|
|
|
|
|
2022-09-09 22:12:06 +02:00
|
|
|
|
$(BUILD)/wlr-layer-shell-protocol.h: wlr-layer-shell-unstable-v1.xml
|
2022-09-06 23:36:03 +02:00
|
|
|
|
wayland-scanner client-header < "$^" > "$@"
|
2022-09-09 22:12:06 +02:00
|
|
|
|
$(BUILD)/wlr-layer-shell-protocol.c: wlr-layer-shell-unstable-v1.xml
|
2022-09-06 23:36:03 +02:00
|
|
|
|
wayland-scanner private-code < "$^" > "$@"
|
|
|
|
|
|
2022-09-09 22:12:06 +02:00
|
|
|
|
$(BUILD)/xdg-shell-client-protocol.h: /usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml
|
2022-09-06 23:36:03 +02:00
|
|
|
|
wayland-scanner client-header < "$^" > "$@"
|
2022-09-09 22:12:06 +02:00
|
|
|
|
$(BUILD)/xdg-shell-protocol.c: /usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml
|
2022-09-06 23:36:03 +02:00
|
|
|
|
wayland-scanner private-code < "$^" > "$@"
|
|
|
|
|
|
2022-09-09 22:12:06 +02:00
|
|
|
|
C_FILES = $(wildcard *.c) $(BUILD)/wlr-layer-shell-protocol.c $(BUILD)/xdg-shell-protocol.c
|
2022-09-06 23:36:03 +02:00
|
|
|
|
|
2022-09-09 22:12:06 +02:00
|
|
|
|
$(BUILD)/wl-overlay: $(C_FILES) $(BUILD)/wlr-layer-shell-protocol.h
|
2022-09-07 16:28:43 +02:00
|
|
|
|
$(CC) $(CFLAGS) $(INC) $(LDFLAGS) $(LDLIBS) -o "$@" $(C_FILES)
|