123456789101112131415161718192021222324252627
  1. ifeq ($(PREFIX),)
  2. PREFIX := /usr
  3. endif
  4. BINDIR=$(DESTDIR)$(PREFIX)/bin
  5. MANDIR=$(DESTDIR)$(PREFIX)/share/man/man1
  6. CC=gcc
  7. CFLAGS=-std=c89 -O2 -pedantic -Wall -I"./include" -D_XOPEN_SOURCE=500
  8. light: src/helpers.c src/light.c src/main.c
  9. $(CC) $(CFLAGS) -g -o $@ $^
  10. install: light
  11. install -dZ $(BINDIR)
  12. install -DZ -m 4755 ./light -t $(BINDIR)
  13. install -dZ $(MANDIR)
  14. install -DZ light.1 -t $(MANDIR)
  15. uninstall:
  16. rm -f $(BINDIR)/light
  17. rm -rf /etc/light
  18. rm -f $(MANDIR)/light.1.gz
  19. clean:
  20. rm -vfr *~ light light.1.gz
  21. .PHONY: man install uninstall clean