diff options
author | Mikhail Burakov <mburakov@mailbox.org> | 2023-10-15 09:28:50 +0200 |
---|---|---|
committer | Mikhail Burakov <mburakov@mailbox.org> | 2023-10-15 16:36:02 +0200 |
commit | 9adec996efea0356547e797b36046103bec449e0 (patch) | |
tree | 456ee32048b38ba73085eb0487b1376088f320a7 /makefile | |
parent | 0e3c61abed24e2fec2148b22fe204e28074f1e90 (diff) |
Preparations for adding wlr capturing
Diffstat (limited to 'makefile')
-rw-r--r-- | makefile | 26 |
1 files changed, 24 insertions, 2 deletions
@@ -15,11 +15,24 @@ libs:=\ libva \ libva-drm +protocols_dir:=\ + wlr-protocols/unstable + +protocols:=\ + wlr-export-dmabuf-unstable-v1 + res:=\ vertex.glsl \ luma.glsl \ chroma.glsl +ifdef USE_WAYLAND + obj:=$(patsubst %,%.o,$(protocols)) $(obj) + headers:=$(patsubst %,%.h,$(protocols)) + libs+=wayland-client + CFLAGS+=-DUSE_WAYLAND +endif + #CFLAGS+=-DUSE_EGL_MESA_PLATFORM_SURFACELESS CFLAGS+=$(shell pkg-config --cflags $(libs)) LDFLAGS+=$(shell pkg-config --libs $(libs)) @@ -35,10 +48,19 @@ all: $(bin) $(bin): $(obj) $(CC) $^ $(LDFLAGS) -o $@ -%.o: %.c *.h $(res) +%.o: %.c *.h $(res) $(headers) $(CC) -c $< $(CFLAGS) -o $@ +%.h: $(protocols_dir)/%.xml + wayland-scanner client-header $< $@ + +%.c: $(protocols_dir)/%.xml + wayland-scanner private-code $< $@ + clean: - -rm $(bin) $(obj) + -rm $(bin) $(obj) $(headers) \ + $(foreach proto,$(protocols),$(proto).h $(proto).o) .PHONY: all clean + +.PRECIOUS: $(headers) |