Makefile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 hb.c
  6. OBJ = $(SRC:.c=.o)
  7. all: options st
  8. options:
  9. @echo st build options:
  10. @echo "CFLAGS = $(STCFLAGS)"
  11. @echo "LDFLAGS = $(STLDFLAGS)"
  12. @echo "CC = $(CC)"
  13. config.h:
  14. cp config.def.h config.h
  15. .c.o:
  16. $(CC) $(STCFLAGS) -c $<
  17. st.o: config.h st.h win.h
  18. x.o: arg.h config.h st.h win.h hb.h
  19. hb.o: st.h
  20. $(OBJ): config.h config.mk
  21. st: $(OBJ)
  22. $(CC) -o $@ $(OBJ) $(STLDFLAGS)
  23. clean:
  24. rm -f st $(OBJ) st-$(VERSION).tar.gz
  25. dist: clean
  26. mkdir -p st-$(VERSION)
  27. cp -R FAQ LEGACY TODO LICENSE Makefile README config.mk\
  28. config.def.h st.info st.1 arg.h st.h win.h $(SRC)\
  29. st-$(VERSION)
  30. tar -cf - st-$(VERSION) | gzip > st-$(VERSION).tar.gz
  31. rm -rf st-$(VERSION)
  32. install: st
  33. mkdir -p $(DESTDIR)$(PREFIX)/bin
  34. cp -f st $(DESTDIR)$(PREFIX)/bin
  35. chmod 755 $(DESTDIR)$(PREFIX)/bin/st
  36. mkdir -p $(DESTDIR)$(MANPREFIX)/man1
  37. sed "s/VERSION/$(VERSION)/g" < st.1 > $(DESTDIR)$(MANPREFIX)/man1/st.1
  38. chmod 644 $(DESTDIR)$(MANPREFIX)/man1/st.1
  39. tic -sx st.info
  40. @echo Please see the README file regarding the terminfo entry of st.
  41. uninstall:
  42. rm -f $(DESTDIR)$(PREFIX)/bin/st
  43. rm -f $(DESTDIR)$(MANPREFIX)/man1/st.1
  44. .PHONY: all options clean dist install uninstall