makefile 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. #
  2. # makefile
  3. #
  4. # Based on Anthonys Editor January 93
  5. #
  6. # Public Domain 1991, 1993 by Anthony Howe. No warranty.
  7. # BSD 3-Clause 2023-2024 by Kevin Bloom.
  8. #
  9. LSP ?= no
  10. UNAME = uname
  11. OPSYS := ${:!${UNAME} -s!}
  12. .if $(OPSYS) == "Darwin"
  13. PREFIX ?= /usr/local
  14. SPACER ?= share/
  15. .elif $(OPSYS) == "Linux"
  16. PREFIX ?= /usr/local
  17. .else
  18. PREFIX ?= /usr/pkg
  19. .endif
  20. DESTDIR ?=
  21. INSTALLDIR ?= $(DESTDIR)$(PREFIX)/bin/
  22. SHAREDIR ?= $(DESTDIR)$(PREFIX)/share/
  23. MANDIR ?= $(DESTDIR)$(PREFIX)/$(SPACER)man/man1/
  24. CC = cc
  25. CFLAGS = -g -O3 -Wall
  26. LD = cc
  27. LDFLAGS =
  28. CP = cp
  29. MV = mv
  30. RM = rm
  31. IN = install
  32. MKDIR = mkdir
  33. AWK = awk
  34. E =
  35. O = .o
  36. H = .h
  37. L = .lua
  38. OR = .orig
  39. OBJ = command$(O) display$(O) gap$(O) key$(O) search$(O) buffer$(O) replace$(O) window$(O) complete$(O) hilite$(O) util$(O) shell$(O) main$(O)
  40. all: ait$(E)
  41. ait$(E) : $(OBJ)
  42. $(LD) $(LDFLAGS) -o ait$(E) $(OBJ) $(LIBS)
  43. command$(O): command.c
  44. $(CC) $(CFLAGS) -c command.c
  45. complete$(O): complete.c
  46. $(CC) $(CFLAGS) -c complete.c
  47. display$(O): display.c
  48. $(CC) $(CFLAGS) -c display.c
  49. gap$(O): gap.c
  50. $(CC) $(CFLAGS) -c gap.c
  51. key$(O): key.c
  52. $(CC) $(CFLAGS) -c key.c
  53. search$(O): search.c
  54. $(CC) $(CFLAGS) -c search.c
  55. replace$(O): replace.c
  56. $(CC) $(CFLAGS) -c replace.c
  57. window$(O): window.c
  58. $(CC) $(CFLAGS) -c window.c
  59. buffer$(O): buffer.c
  60. $(CC) $(CFLAGS) -c buffer.c
  61. hilite$(O): hilite.c
  62. $(CC) $(CFLAGS) -c hilite.c
  63. util$(O): util.c
  64. $(CC) $(CFLAGS) -c util.c
  65. shell$(O): shell.c
  66. $(CC) $(CFLAGS) -c shell.c
  67. main$(O): main.c
  68. $(CC) $(CFLAGS) -c main.c
  69. clean:
  70. -$(RM) $(OBJ) ait$(E)
  71. .if $(LSP) == "yes"
  72. install: install-lsp
  73. .else
  74. install:
  75. .endif
  76. -$(IN) -m755 ait$(E) $(INSTALLDIR)
  77. -$(IN) -m644 ait.1 $(MANDIR)
  78. install-lsp:
  79. -$(MKDIR) $(SHAREDIR)ait
  80. -$(AWK) -vdir="$(SHAREDIR)ait" -f replace-share.awk \
  81. scripts/lsp$(OR) > scripts/lsp$(E)
  82. -$(AWK) -vdir="$(SHAREDIR)ait" -f replace-share.awk \
  83. scripts/lsp-server$(OR) > scripts/lsp-server$(E)
  84. -$(IN) -m755 scripts/lsp-server$(L) $(SHAREDIR)ait/
  85. -$(IN) -m755 scripts/lsp-extract$(L) $(SHAREDIR)ait/
  86. -$(IN) -m755 scripts/lsp$(E) $(INSTALLDIR)
  87. -$(IN) -m755 scripts/lsp-server$(E) $(INSTALLDIR)
  88. uninstall:
  89. -$(RM) $(INSTALLDIR)ait$(E)
  90. -$(RM) $(MANDIR)ait.1
  91. -$(RM) -rf $(SHAREDIR)ait