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