Makefile 591 B

12345678910111213141516171819
  1. WAYLAND=`pkg-config wayland-client --cflags --libs`
  2. WAYLAND_SCANNER=wayland-scanner
  3. WAYLAND_PROTOCOLS_DIR=/usr/share/wayland-protocols
  4. CFLAGS?=-std=c99 -Wall -Wextra -pedantic -Wno-unused-function -O3 -fvisibility=hidden
  5. .PHONY: clean
  6. demo: main.c xdg-shell.c xdg-shell.h
  7. $(CC) $(CFLAGS) -o demo *.c $(WAYLAND) -lrt -lm
  8. xdg-shell.c:
  9. $(WAYLAND_SCANNER) code $(WAYLAND_PROTOCOLS_DIR)/stable/xdg-shell/xdg-shell.xml xdg-shell.c
  10. xdg-shell.h:
  11. $(WAYLAND_SCANNER) client-header $(WAYLAND_PROTOCOLS_DIR)/stable/xdg-shell/xdg-shell.xml xdg-shell.h
  12. clean:
  13. $(RM) demo xdg-shell.c xdg-shell.h