Makefile 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. $(OBJ): arg.h config.h config.mk drw.h
  17. dmenu: dmenu.o drw.o util.o
  18. $(CC) -o $@ dmenu.o drw.o util.o $(LDFLAGS)
  19. stest: stest.o
  20. $(CC) -o $@ stest.o $(LDFLAGS)
  21. clean:
  22. rm -f dmenu stest $(OBJ) dmenu-$(VERSION).tar.gz
  23. dist: clean
  24. mkdir -p dmenu-$(VERSION)
  25. cp LICENSE Makefile README arg.h config.def.h config.mk dmenu.1\
  26. drw.h util.h dmenu_path dmenu_run stest.1 $(SRC)\
  27. dmenu-$(VERSION)
  28. tar -cf dmenu-$(VERSION).tar dmenu-$(VERSION)
  29. gzip dmenu-$(VERSION).tar
  30. rm -rf dmenu-$(VERSION)
  31. install: all
  32. mkdir -p $(DESTDIR)$(PREFIX)/bin
  33. cp -f dmenu dmenu_path dmenu_run stest $(DESTDIR)$(PREFIX)/bin
  34. chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu
  35. chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_path
  36. chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_run
  37. chmod 755 $(DESTDIR)$(PREFIX)/bin/stest
  38. mkdir -p $(DESTDIR)$(MANPREFIX)/man1
  39. sed "s/VERSION/$(VERSION)/g" < dmenu.1 > $(DESTDIR)$(MANPREFIX)/man1/dmenu.1
  40. sed "s/VERSION/$(VERSION)/g" < stest.1 > $(DESTDIR)$(MANPREFIX)/man1/stest.1
  41. chmod 644 $(DESTDIR)$(MANPREFIX)/man1/dmenu.1
  42. chmod 644 $(DESTDIR)$(MANPREFIX)/man1/stest.1
  43. uninstall:
  44. rm -f $(DESTDIR)$(PREFIX)/bin/dmenu\
  45. $(DESTDIR)$(PREFIX)/bin/dmenu_path\
  46. $(DESTDIR)$(PREFIX)/bin/dmenu_run\
  47. $(DESTDIR)$(PREFIX)/bin/stest\
  48. $(DESTDIR)$(MANPREFIX)/man1/dmenu.1\
  49. $(DESTDIR)$(MANPREFIX)/man1/stest.1
  50. .PHONY: all options clean dist install uninstall