-rw-r--r-- Makefile
1 SOURCES = $(filter-out src/wimptool.c, $(wildcard src/*.c)) 2 OBJECTS = $(SOURCES:.c=.o) 3 CFLAGS += -g -I. -DWLR_USE_UNSTABLE -Wall -Wextra -pedantic -Wno-unused-parameter 4 LDFLAGS += $(shell pkg-config --cflags --libs wlroots) \ 5 $(shell pkg-config --cflags --libs wayland-server) \ 6 $(shell pkg-config --cflags --libs xkbcommon) \ 7 $(shell pkg-config --cflags --libs libinput) \ 8 $(shell pkg-config --cflags --libs cairo) \ 9 $(shell pkg-config --cflags --libs pixman-1) \ 10 -lm 11 12 all: wimp wimptool 13 14 PREFIX ?= /usr/local 15 BINPREFIX ?= $(PREFIX)/bin 16 17 wimp: xdg-shell-protocol wlr-layer-shell-unstable-v1-protocol ${OBJECTS} 18 @$(CC) -o wimp $(OBJECTS) $(LDFLAGS) 19 20 %.o: %.c %.h 21 @$(CC) $(CFLAGS) -c -o $@ $< ${LDFLAGS} 22 23 wimptool: src/wimptool.c 24 @$(CC) $(CFLAGS) -o $@ $< 25 26 WAYLAND_PROTOCOLS=$(shell pkg-config --variable=pkgdatadir wayland-protocols) 27 WAYLAND_SCANNER=$(shell pkg-config --variable=wayland_scanner wayland-scanner) 28 29 xdg-shell-protocol: 30 @$(WAYLAND_SCANNER) server-header $(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@.h 31 @$(WAYLAND_SCANNER) private-code $(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@.c 32 33 wlr-layer-shell-unstable-v1-protocol: 34 @$(WAYLAND_SCANNER) server-header protocols/wlr-layer-shell-unstable-v1.xml $@.h 35 @$(WAYLAND_SCANNER) private-code protocols/wlr-layer-shell-unstable-v1.xml $@.c 36 37 clean: 38 rm -f wimp wimptool *-protocol.h *-protocol.c ${OBJECTS} 39 40 install: 41 mkdir -p "$(DESTDIR)$(BINPREFIX)" 42 cp -pf "wimp" "$(DESTDIR)$(BINPREFIX)" 43 44 uninstall: 45 rm -f "$(DESTDIR)$(BINPREFIX)/wimp" 46 47 .PHONY: all clean install uninstall 48