Makefile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # Customize here:
  2. INSTALLDIR = /home/fare/bin/i386
  3. SAVEDIR = /home/arc/lang/forth/Linux
  4. TARFILE = $(SAVEDIR)/$(PACKAGE_NAME).tar.gz
  5. BINMODE = 0755
  6. INSTALL = install --strip -c -m $(BINMODE)
  7. CPP = /usr/bin/gcc -E
  8. RM = /bin/rm -f
  9. AS = as
  10. LD = ld
  11. FORMAT = __ELF__
  12. # If you still have an a.out compiler, you may try the following (untested):
  13. #AS = /usr/i486-linuxaout/bin/as
  14. #LD = /usr/i486-linuxaout/bin/ld -m i386linux
  15. #FORMAT = __AOUT__
  16. ### Maintainer-only stuff ###
  17. EFORTH_VERSION = 1.0
  18. LINUX_PORT_VER = e
  19. PACKAGE_NAME = linux-eforth-$(EFORTH_VERSION)$(LINUX_PORT_VER)
  20. FILES = Makefile eforth.S test.4th \
  21. README FILES README.eforth README.linux \
  22. Changelog TODO \
  23. Glossary eforth.4th
  24. DEFINES = -Dlinux -D$(FORMAT)
  25. .SUFFIXES: .o .s .S .l
  26. .PHONY: clean veryclean install tar test
  27. %.o %.l: %.s
  28. $(AS) -adhls=$*.l -o $@ $<
  29. %.s: %.S
  30. $(CPP) $(DEFINES) $< > $@
  31. eforth: eforth.o
  32. $(LD) -N -e __init__ -o $@ $<
  33. eforth.o: eforth.s
  34. eforth.s: eforth.S
  35. clean:
  36. [ -n "$(wildcard *.o *.s core*)" ] && \
  37. $(RM) $(wildcard *.[loss] core*) || :
  38. veryclean: clean
  39. [ -f eforth ] && $(RM) eforth || :
  40. install: eforth
  41. $(INSTALL) eforth $(INSTALLDIR)
  42. tar:
  43. ln -sf . $(PACKAGE_NAME) && \
  44. tar zcvf $(TARFILE) \
  45. `for i in $(FILES) ; do echo $(PACKAGE_NAME)/$$i ; done` ; \
  46. rm -f $(PACKAGE_NAME)
  47. test: eforth
  48. ./eforth foo bar baz quux < test.4th
  49. stripped: eforth
  50. strip eforth