~earboxer/suggpicker

suggpicker/Makefile -rw-r--r-- 1.2 KiB
fd0edc9aZach DeCook release: minor version bump 4 months ago
                                                                                
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
include config.mk

NAME=suggpicker
BIN=${NAME}
MAN=${NAME}.1
SRC=.

PKGS = wayland-client pangocairo

PREFIX?=/usr/local
MY_SOURCES += $(wildcard $(SRC)/*.c)
MY_HEADERS += $(wildcard $(SRC)/*.h)

CFLAGS += -std=gnu99 -Wall -g -DWITH_WAYLAND_SHM
CFLAGS += $(shell pkg-config --cflags $(PKGS))
LDFLAGS =$(shell pkg-config --libs $(PKGS)) -lm -lutil -lrt

WAYLAND_HEADERS = $(wildcard proto/*.xml)

HDRS = $(WAYLAND_HEADERS:.xml=-client-protocol.h)
WAYLAND_SRC = $(HDRS:.h=.c)
SOURCES = $(MY_SOURCES) $(WAYLAND_SRC)

OBJECTS = $(SOURCES:.c=.o)

all: ${BIN} ${MAN}

proto/%-client-protocol.c: proto/%.xml
	wayland-scanner code < $? > $@

proto/%-client-protocol.h: proto/%.xml
	wayland-scanner client-header < $? > $@

$(OBJECTS): $(HDRS) $(MY_HEADERS)

${BIN}: config.h $(OBJECTS)
	$(CC) -o ${BIN} $(OBJECTS) $(LDFLAGS)

${MAN}: ${MAN}.scd
	scdoc < $? > $@

clean:
	rm -f $(OBJECTS) $(HDRS) $(WAYLAND_SRC) ${BIN}

format:
	clang-format -i $(MY_SOURCES) $(MY_HEADERS)

install: all
	mkdir -p ${DESTDIR}${PREFIX}/bin
	cp -f ${BIN} ${DESTDIR}${PREFIX}/bin
	chmod 755 ${DESTDIR}${PREFIX}/bin/${BIN}
	mkdir -p ${DESTDIR}${PREFIX}/share/man/man1
	cp -f ${MAN} ${DESTDIR}${PREFIX}/share/man/man1