mirror of
https://git.sr.ht/~leon_plickat/wlopm
synced 2024-12-26 05:28:22 +01:00
a385b761bd
The makefile already use (directly, or indirectly) CPPFLAGS and LDFLAGS, so it makes sense to also use the user provided CFLAGS. One example where this is necessary is if the user has set CPPFLAGS=”-D_FORTIFY_SOURCE=2”, which, before this patch, results in (even if the user has set CFLAGS=-O2): /usr/include/features.h:397:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) -Werror=cpp]
36 lines
914 B
Makefile
36 lines
914 B
Makefile
SCANNER := wayland-scanner
|
|
|
|
PREFIX=/usr/local
|
|
BINDIR=$(PREFIX)/bin
|
|
MANDIR=$(PREFIX)/share/man
|
|
|
|
CFLAGS+=-Wall -Werror -Wextra -Wpedantic -Wno-unused-parameter -Wconversion -Wformat-security -Wformat -Wsign-conversion -Wfloat-conversion -Wunused-result
|
|
LIBS=-lwayland-client
|
|
OBJ=wlopm.o wlr-output-power-management-unstable-v1.o xdg-output-unstable-v1.o
|
|
GEN=wlr-output-power-management-unstable-v1.c wlr-output-power-management-unstable-v1.h xdg-output-unstable-v1.c xdg-output-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 wlopm $(DESTDIR)$(BINDIR)/wlopm
|
|
install -D wlopm.1 $(DESTDIR)$(MANDIR)/man1/wlopm.1
|
|
|
|
uninstall:
|
|
$(RM) $(DESTDIR)$(BINDIR)/wlopm
|
|
$(RM) $(DESTDIR)$(MANDIR)/man1/wlopm.1
|
|
|
|
clean:
|
|
$(RM) wlopm $(GEN) $(OBJ)
|
|
|
|
.PHONY: clean install
|
|
|