Makefile 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # dmenu - dynamic menu
  2. # See LICENSE file for copyright and license details.
  3. include config.mk
  4. SRC = drw.c dmenu.c stest.c util.c
  5. OBJ = $(SRC:.c=.o)
  6. all: options dmenu stest
  7. options:
  8. @echo dmenu build options:
  9. @echo "CFLAGS = $(CFLAGS)"
  10. @echo "LDFLAGS = $(LDFLAGS)"
  11. @echo "CC = $(CC)"
  12. .c.o:
  13. $(CC) -c $(CFLAGS) $<
  14. config.h:
  15. cp config.def.h $@
  16. config.mk: config.def.mk
  17. cp config.def.mk $@
  18. $(OBJ): arg.h config.h config.mk drw.h
  19. dmenu: dmenu.o drw.o util.o
  20. $(CC) -o $@ dmenu.o drw.o util.o $(LDFLAGS)
  21. stest: stest.o
  22. $(CC) -o $@ stest.o $(LDFLAGS)
  23. clean:
  24. rm -f dmenu stest $(OBJ) dmenu-$(VERSION).tar.gz
  25. dist: clean
  26. mkdir -p dmenu-$(VERSION)
  27. cp LICENSE Makefile README arg.h config.def.h config.mk dmenu.1\
  28. drw.h util.h dmenu_path dmenu_run stest.1 $(SRC)\
  29. dmenu-$(VERSION)
  30. tar -cf dmenu-$(VERSION).tar dmenu-$(VERSION)
  31. gzip dmenu-$(VERSION).tar
  32. rm -rf dmenu-$(VERSION)
  33. install: all
  34. mkdir -p $(DESTDIR)$(PREFIX)/bin
  35. cp -f dmenu dmenu_path dmenu_run stest $(DESTDIR)$(PREFIX)/bin
  36. chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu
  37. chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_path
  38. chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_run
  39. chmod 755 $(DESTDIR)$(PREFIX)/bin/stest
  40. mkdir -p $(DESTDIR)$(MANPREFIX)/man1
  41. sed "s/VERSION/$(VERSION)/g" < dmenu.1 > $(DESTDIR)$(MANPREFIX)/man1/dmenu.1
  42. sed "s/VERSION/$(VERSION)/g" < stest.1 > $(DESTDIR)$(MANPREFIX)/man1/stest.1
  43. chmod 644 $(DESTDIR)$(MANPREFIX)/man1/dmenu.1
  44. chmod 644 $(DESTDIR)$(MANPREFIX)/man1/stest.1
  45. uninstall:
  46. rm -f $(DESTDIR)$(PREFIX)/bin/dmenu\
  47. $(DESTDIR)$(PREFIX)/bin/dmenu_path\
  48. $(DESTDIR)$(PREFIX)/bin/dmenu_run\
  49. $(DESTDIR)$(PREFIX)/bin/stest\
  50. $(DESTDIR)$(MANPREFIX)/man1/dmenu.1\
  51. $(DESTDIR)$(MANPREFIX)/man1/stest.1
  52. .PHONY: all options clean dist install uninstall