55 lines
2 KiB
Makefile
55 lines
2 KiB
Makefile
# This file is part of wl-overlay: show overlays with images and text in Wayland
|
||
# Copyright © 2022 Midgard
|
||
#
|
||
# This program is free software: you can redistribute it and/or modify
|
||
# it under the terms of the GNU General Public License as published by
|
||
# the Free Software Foundation, either version 3 of the License, or
|
||
# (at your option) any later version.
|
||
#
|
||
# This program is distributed in the hope that it will be useful,
|
||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
# GNU General Public License for more details.
|
||
#
|
||
# You should have received a copy of the GNU General Public License
|
||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
|
||
|
||
# Choose a dedicated build directory as ‘make clean’ will remove it entirely
|
||
BUILD = build
|
||
$(shell mkdir -p $(BUILD))
|
||
|
||
CFLAGS += -Wall
|
||
|
||
CFLAGS += $(shell pkg-config --cflags pangocairo)
|
||
LDLIBS += $(shell pkg-config --libs pangocairo)
|
||
|
||
CFLAGS += $(shell pkg-config --cflags cairo)
|
||
LDLIBS += $(shell pkg-config --libs cairo)
|
||
|
||
CFLAGS += $(shell pkg-config --cflags wayland-client)
|
||
LDLIBS += $(shell pkg-config --libs wayland-client)
|
||
|
||
LDLIBS += -lrt
|
||
|
||
.PHONY: all clean
|
||
|
||
all: build/wl-overlay
|
||
|
||
clean:
|
||
rm -rf $(BUILD)
|
||
|
||
$(BUILD)/wlr-layer-shell-protocol.h: wlr-layer-shell-unstable-v1.xml
|
||
wayland-scanner client-header < "$^" > "$@"
|
||
$(BUILD)/wlr-layer-shell-protocol.c: wlr-layer-shell-unstable-v1.xml
|
||
wayland-scanner private-code < "$^" > "$@"
|
||
|
||
$(BUILD)/xdg-shell-client-protocol.h: /usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml
|
||
wayland-scanner client-header < "$^" > "$@"
|
||
$(BUILD)/xdg-shell-protocol.c: /usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml
|
||
wayland-scanner private-code < "$^" > "$@"
|
||
|
||
C_FILES = $(wildcard *.c) $(BUILD)/wlr-layer-shell-protocol.c $(BUILD)/xdg-shell-protocol.c
|
||
|
||
$(BUILD)/wl-overlay: $(C_FILES) $(BUILD)/wlr-layer-shell-protocol.h
|
||
$(CC) $(CFLAGS) $(INC) $(LDFLAGS) $(LDLIBS) -o "$@" $(C_FILES)
|