logo

inaban

Distrustful Wayland Compositor (inspired by XMonad and dwm) git clone https://hacktivis.me/git/inaban.git

Makefile (1927B)


  1. # SPDX-FileCopyrightText: 2019-2022 inaban Authors <https://hacktivis.me/git/inaban>
  2. # SPDX-License-Identifier: BSD-3-Clause
  3. # POSIX-ish Makefile with extensions common to *BSD and GNU such as:
  4. # - Usage of backticks for shell evaluation
  5. # - Usage of ?= for defining variables when not already defined
  6. # - Usage of += for appending to a variable
  7. VERSION = 0.0.1
  8. VERSION_FULL = $(VERSION)`./version.sh`
  9. PREFIX = /usr/local
  10. BINDIR = $(PREFIX)/bin
  11. MANDIR = $(PREFIX)/share/man
  12. DATADIR = $(PREFIX)/share/inaban
  13. CC ?= cc
  14. CFLAGS ?= -g -Wall -Wextra -Wconversion -Wsign-conversion -O2
  15. DBG ?=
  16. PKGCONFIG ?= pkg-config
  17. DEPS = xkbcommon wlroots wayland-server
  18. EXE = inaban
  19. TRANS =
  20. SRC = xdg-decoration.c commands.c inaban.c
  21. CDEPS = -DDATADIR=\"$(DATADIR)\" -DPACKAGE=\"$(PACKAGE)\" -D_POSIX_C_SOURCE=200809L -I./protocols
  22. CDEPS += `pkg-config --cflags $(DEPS)`
  23. LIBS = `pkg-config --libs $(DEPS)`
  24. WAYLAND_PROTOCOLS=`pkg-config --variable=pkgdatadir wayland-protocols`
  25. WAYLAND_SCANNER=`pkg-config --variable=wayland_scanner wayland-scanner`
  26. all: protocols/xdg-shell-protocol.c $(EXE) $(TRANS)
  27. inaban: $(SRC) inaban.h config.h
  28. $(CC) -std=c99 $(CFLAGS) $(CDEPS) -o $@ $(SRC) $(LDFLAGS) $(LIBS)
  29. protocols/xdg-shell-protocol.h:
  30. $(WAYLAND_SCANNER) server-header $(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
  31. protocols/xdg-shell-protocol.c: protocols/xdg-shell-protocol.h
  32. $(WAYLAND_SCANNER) private-code $(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
  33. install: all
  34. mkdir -p $(DESTDIR)$(BINDIR)
  35. cp -p $(EXE) $(DESTDIR)$(BINDIR)/$(EXE)
  36. mkdir -p $(DESTDIR)$(MANDIR)/man1
  37. cp -p $(EXE).1 $(DESTDIR)$(MANDIR)/man1
  38. #mkdir -p $(DESTDIR)$(DATADIR)/locale
  39. #cp -r locale/ $(DESTDIR)$(DATADIR)
  40. clean:
  41. rm -fr locale $(EXE) protocols/xdg-shell-protocol.c protocols/xdg-shell-protocol.h
  42. format: *.c *.h
  43. clang-format -style=file -assume-filename=.clang-format -i *.c *.h
  44. .PHONY: clean install