LED is a lightweight text editor written using Go.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
814 B

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. SHELL := /bin/bash
  2. FILE := tmp.txt
  3. CAT := bat
  4. ifeq (, $(shell which bat))
  5. $(error "No bat in $(PATH), consider installing ti")
  6. CAT = cat
  7. endif
  8. build_and_run: clean build run
  9. .PHONY : build_and_run build run clean testfile install
  10. build :
  11. @echo "-> Building"
  12. @cd utils/; go build .; cd ..
  13. @go build .
  14. @echo "-> Done"
  15. build_silent :
  16. @cd utils/; go build .; cd ..
  17. @go build .
  18. run :
  19. @echo "-> Running"
  20. @./led $(FILE)
  21. clean :
  22. @echo "-> Cleaning up"
  23. @-rm led
  24. install : build_silent
  25. @echo "WOW, you're either brave or very stupid..."
  26. @echo "-> Installing led in /usr/local/bin/led"
  27. @ln -sF $(shell pwd)/led /usr/local/bin/led
  28. @echo "-> Done"
  29. testfile :
  30. @echo -e "-> Generating test file"
  31. @echo -e "This is a line.\nThis is another line.\n\n\nThis is the end." > tmp.txt
  32. @$(CAT) tmp.txt