File: Makefile

package info (click to toggle)
wev 1.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 144 kB
  • sloc: ansic: 1,395; makefile: 89
file content (52 lines) | stat: -rw-r--r-- 1,562 bytes parent folder | download
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
PKG_CONFIG ?= pkg-config
WAYLAND_PROTOCOLS=$(shell $(PKG_CONFIG) --variable=pkgdatadir wayland-protocols)
WAYLAND_SCANNER=$(shell $(PKG_CONFIG) --variable=wayland_scanner wayland-scanner)
SCDOC=$(shell $(PKG_CONFIG) --variable=scdoc scdoc)
LIBS=\
	 $(shell $(PKG_CONFIG) --cflags --libs wayland-client) \
	 $(shell $(PKG_CONFIG) --cflags --libs xkbcommon)

xdg-shell-protocol.h:
	$(WAYLAND_SCANNER) client-header \
		$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@

xdg-shell-protocol.c: xdg-shell-protocol.h
	$(WAYLAND_SCANNER) private-code \
		$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@

wayland-tablet-protocol.h:
	$(WAYLAND_SCANNER) client-header \
		$(WAYLAND_PROTOCOLS)/stable/tablet/tablet-v2.xml $@

wayland-tablet-protocol.c: wayland-tablet-protocol.h
	$(WAYLAND_SCANNER) private-code \
		$(WAYLAND_PROTOCOLS)/stable/tablet/tablet-v2.xml $@

wev: wev.c shm.c xdg-shell-protocol.c wayland-tablet-protocol.c
	$(CC) $(CFLAGS) \
		-g -std=c11 -I. \
		-o wev wev.c shm.c xdg-shell-protocol.c wayland-tablet-protocol.c \
		$(LIBS) -lrt

wev.1: wev.1.scd
	$(SCDOC) < wev.1.scd > wev.1

all: wev wev.1

PREFIX?=/usr/local
BINDIR?=$(PREFIX)/bin
SHAREDIR?=$(PREFIX)/share
MANDIR?=$(SHAREDIR)/man
DESTDIR?=

install: wev
	mkdir -p $(DESTDIR)$(BINDIR)
	mkdir -p $(DESTDIR)$(MANDIR)/man1
	install -m755 wev $(DESTDIR)$(BINDIR)/wev
	install -m644 wev.1 $(DESTDIR)$(MANDIR)/man1/wev.1

clean:
	rm -f wev wev.1 xdg-shell-protocol.h xdg-shell-protocol.c wayland-tablet-protocol.h wayland-tablet-protocol.c

.DEFAULT_GOAL=all
.PHONY: all install clean