aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd/dwm/rules.mk
blob: 610987a9824a48bd17fb0ed1a82dd2e24e9ff48f (plain)
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
include share/push.mk

WL_DIR     = $(shell pkg-config --variable=pkgdatadir wayland-protocols)
WL_SCAN    = $(shell pkg-config --variable=wayland_scanner wayland-scanner)
PROTO_DIR := $(d)/protocols

# Local sources
SRCS_$(d) := \
	$(d)/xdg-shell.c \
	$(d)/wlr-layer-shell.c  \
	$(d)/util.c \
	$(d)/output.c \
	$(d)/input.c \
	$(d)/client.c \
	$(d)/decoration.c \
	$(d)/layer.c \
	$(d)/layout.c \
	$(d)/func.c \
	$(d)/dwm.c

BINS_$(d) := $(d)/dwm

include share/paths.mk

# Local rules
$(d)/xdg-shell.h:
	$(WL_SCAN) server-header $(WL_DIR)/stable/xdg-shell/xdg-shell.xml $@

$(d)/xdg-shell.c: $(d)/xdg-shell.h
	$(WL_SCAN) private-code $(WL_DIR)/stable/xdg-shell/xdg-shell.xml $@

# could make this a patterned rule...
$(d)/wlr-layer-shell.h: $(PROTO_DIR)/wlr-layer-shell-unstable-v1.xml
	$(WL_SCAN) server-header $(PROTO_DIR)/wlr-layer-shell-unstable-v1.xml $@

$(d)/wlr-layer-shell.c: $(d)/wlr-layer-shell.h
	$(WL_SCAN) private-code $(PROTO_DIR)/wlr-layer-shell-unstable-v1.xml $@

include share/dynamic.mk
$(BINS_$(d)): TCFLAGS := $(shell pkg-config --cflags xkbcommon) \
						 $(shell pkg-config --cflags wlroots) \
						 $(shell pkg-config --cflags wayland-server) 
$(BINS_$(d)): TCLIBS  := $(shell pkg-config --libs xkbcommon) \
						 $(shell pkg-config --libs wlroots) \
						 $(shell pkg-config --libs wayland-server)  

$(BINS_$(d)): $(OBJS_$(d)) $(OBJ_DIR)/libn/libn.a
	$(COMPLINK)

include share/pop.mk