Makefile 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # st - simple terminal
  2. # See LICENSE file for copyright and license details.
  3. .POSIX:
  4. include config.mk
  5. SRC = st.c x.c
  6. OBJ = $(SRC:.c=.o)
  7. all: st
  8. config.h:
  9. cp config.def.h config.h
  10. .c.o:
  11. $(CC) $(STCFLAGS) -c $<
  12. st.o: config.h st.h win.h
  13. x.o: arg.h config.h st.h win.h
  14. $(OBJ): config.h config.mk
  15. st: $(OBJ)
  16. $(CC) -o $@ $(OBJ) $(STLDFLAGS)
  17. clean:
  18. rm -f st $(OBJ) st-$(VERSION).tar.gz
  19. dist: clean
  20. mkdir -p st-$(VERSION)
  21. cp -R FAQ LEGACY TODO LICENSE Makefile README config.mk\
  22. config.def.h st.info st.1 arg.h st.h win.h $(SRC)\
  23. st-$(VERSION)
  24. tar -cf - st-$(VERSION) | gzip > st-$(VERSION).tar.gz
  25. rm -rf st-$(VERSION)
  26. install: st
  27. mkdir -p $(DESTDIR)$(PREFIX)/bin
  28. cp -f st $(DESTDIR)$(PREFIX)/bin
  29. chmod 755 $(DESTDIR)$(PREFIX)/bin/st
  30. mkdir -p $(DESTDIR)$(MANPREFIX)/man1
  31. sed "s/VERSION/$(VERSION)/g" < st.1 > $(DESTDIR)$(MANPREFIX)/man1/st.1
  32. chmod 644 $(DESTDIR)$(MANPREFIX)/man1/st.1
  33. tic -sx st.info
  34. @echo Please see the README file regarding the terminfo entry of st.
  35. uninstall:
  36. rm -f $(DESTDIR)$(PREFIX)/bin/st
  37. rm -f $(DESTDIR)$(MANPREFIX)/man1/st.1
  38. .PHONY: all clean dist install uninstall