wlopm/Makefile
Isaac Freund 41bc661837
Fix bash completion installation
Currently this fails if the directory for the completion does not
already exist, at least with FreeBSD install(1).
2024-12-10 13:58:41 +01:00

41 lines
1.1 KiB
Makefile

SCANNER := wayland-scanner
PREFIX=/usr/local
BINDIR=$(PREFIX)/bin
MANDIR=$(PREFIX)/share/man
BASHCOMPDIR=$(PREFIX)/share/bash-completion/completions
CFLAGS+=-Wall -Werror -Wextra -Wpedantic -Wno-unused-parameter -Wconversion -Wformat-security -Wformat -Wsign-conversion -Wfloat-conversion -Wunused-result -Wno-strict-prototypes
LIBS=-lwayland-client
OBJ=wlopm.o wlr-output-power-management-unstable-v1.o
GEN=wlr-output-power-management-unstable-v1.c wlr-output-power-management-unstable-v1.h
wlopm: $(OBJ)
$(CC) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
$(OBJ): $(GEN)
%.c: %.xml
$(SCANNER) private-code < $< > $@
%.h: %.xml
$(SCANNER) client-header < $< > $@
install: wlopm
install -d $(DESTDIR)$(BINDIR)
install wlopm $(DESTDIR)$(BINDIR)
install -d $(DESTDIR)$(MANDIR)/man1
install -m 644 wlopm.1 $(DESTDIR)$(MANDIR)/man1
install -d $(DESTDIR)$(BASHCOMPDIR)
install bash-completion $(DESTDIR)$(BASHCOMPDIR)/wlopm
uninstall:
$(RM) $(DESTDIR)$(BINDIR)/wlopm
$(RM) $(DESTDIR)$(MANDIR)/man1/wlopm.1
$(RM) $(DESTDIR)$(BASHCOMPDIR)/wlopm
clean:
$(RM) wlopm $(GEN) $(OBJ)
.PHONY: clean install