a simple textfile based psf font editor suite
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.
 
 
 

60 lines
1.5 KiB

  1. # psftools
  2. #
  3. # a simple suite of utilities to provide text based editing of psf files.
  4. #
  5. # Author: Gunnar Zötl <gz@tset.de>, 2016.
  6. # Released under the terms of the MIT/X11 license. See file LICENSE for details.
  7. # directory for installation
  8. BINDIR=/usr/local/bin
  9. # directories for tests: temp dir for test files, will be created for and
  10. # removed after the tests
  11. TESTDIR=./tests
  12. # where to find the linux console font files (or other psf files)
  13. CONSOLEFONTDIR=/usr/share/consolefonts
  14. # build targets
  15. ALL = psfc psfd psfid psft
  16. # build flags
  17. CC = gcc
  18. CFLAGS = -Wall -Wextra -g
  19. LD = gcc
  20. LDFLAGS = -g
  21. all: $(ALL)
  22. $(ALL): %: %.o psf.o
  23. $(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
  24. %.o: %.c psf.h psftools_version.h
  25. $(CC) $(CFLAGS) -o $@ -c $<
  26. install: all
  27. cp $(ALL) $(BINDIR)
  28. clean:; rm -rf *.o $(ALL) *.psf $(TESTDIR)
  29. # test: roundtrip all installed psf fonts and compare results
  30. test: all
  31. @mkdir -p $(TESTDIR)
  32. @rm -f $(TESTDIR)/*
  33. @cp $(CONSOLEFONTDIR)/* $(TESTDIR)
  34. @gzip -d $(TESTDIR)/*.gz
  35. @failed=0; \
  36. for f in $(TESTDIR)/*.psf; do \
  37. ./psfd $$f $$f.txt; \
  38. if [ $$? != "0" ]; then failed=$$(($$failed + 1)); fi; \
  39. ./psfc $$f.txt $$f.1; \
  40. if [ $$? != "0" ]; then failed=$$(($$failed + 1)); fi; \
  41. ./psfd $$f.1 $$f.1.txt; \
  42. if [ $$? != "0" ]; then failed=$$(($$failed + 1)); fi; \
  43. diff -q $$f $$f.1; \
  44. if [ $$? != "0" ]; then failed=$$(($$failed + 1)); fi; \
  45. diff -q $$f.txt $$f.1.txt; \
  46. if [ $$? != "0" ]; then failed=$$(($$failed + 1)); fi; \
  47. done; \
  48. echo Failed: $$failed
  49. @rm -rf $(TESTDIR)