You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
788 B

.PHONY: all clean
CC = gcc
CLIBS = -lwayland-client
CFLAGS = $(CLIBS) -g -fsanitize=address
DESTDIR = /usr/local/bin/
SRC = main.c
OUT = printlease
PROTOCOL_NAMES = $(foreach proto, $(wildcard protocols/*), $(notdir $(basename $(proto))))
PROTOCOL_IMPLS = $(foreach proto, $(PROTOCOL_NAMES), $(addsuffix .prot.c,$(proto)))
PROTOCOL_HEADERS = $(foreach proto, $(PROTOCOL_NAMES), $(addsuffix .prot.h,$(proto)))
PROTOCOLS = $(PROTOCOL_IMPLS) $(PROTOCOL_HEADERS)
%.prot.c: protocols/%.xml
wayland-scanner private-code $< $@
%.prot.h: protocols/%.xml
wayland-scanner client-header $< $@
all: $(OUT)
clean:
rm -f $(OUT)
rm -f $(PROTOCOLS)
$(OUT): $(PROTOCOLS) $(SRC)
$(CC) $(PROTOCOL_IMPLS) $(SRC) $(CFLAGS) -o $(OUT)
run: $(OUT)
./$(OUT)
install: $(OUT)
mv $(OUT) $(DESTDIR)