GNUmakefile 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. #
  2. # GNUmakefile
  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. OPSYS := $(shell uname -s)
  11. ifeq ($(OPSYS), Darwin)
  12. PREFIX ?= /usr/local
  13. SPACER ?= share/
  14. else ifeq ($(OPSYS), Linux)
  15. PREFIX ?= /usr/local
  16. else
  17. PREFIX ?= /usr/pkg
  18. endif
  19. DESTDIR ?=
  20. INSTALLDIR ?= $(DESTDIR)$(PREFIX)/bin/
  21. SHAREDIR ?= $(DESTDIR)$(PREFIX)/share/
  22. MANDIR ?= $(DESTDIR)$(PREFIX)/$(SPACER)man/man1/
  23. CC = cc
  24. CFLAGS = -g -O3 -Wall
  25. LD = cc
  26. LDFLAGS =
  27. CP = cp
  28. MV = mv
  29. RM = rm
  30. IN = install
  31. MKDIR = mkdir
  32. AWK = awk
  33. E =
  34. O = .o
  35. H = .h
  36. L = .lua
  37. OR = .orig
  38. 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)
  39. all: ait$(E)
  40. ait$(E) : $(OBJ)
  41. $(LD) $(LDFLAGS) -o ait$(E) $(OBJ) $(LIBS)
  42. command$(O): command.c
  43. $(CC) $(CFLAGS) -c command.c
  44. complete$(O): complete.c
  45. $(CC) $(CFLAGS) -c complete.c
  46. display$(O): display.c
  47. $(CC) $(CFLAGS) -c display.c
  48. gap$(O): gap.c
  49. $(CC) $(CFLAGS) -c gap.c
  50. key$(O): key.c
  51. $(CC) $(CFLAGS) -c key.c
  52. search$(O): search.c
  53. $(CC) $(CFLAGS) -c search.c
  54. replace$(O): replace.c
  55. $(CC) $(CFLAGS) -c replace.c
  56. window$(O): window.c
  57. $(CC) $(CFLAGS) -c window.c
  58. buffer$(O): buffer.c
  59. $(CC) $(CFLAGS) -c buffer.c
  60. hilite$(O): hilite.c
  61. $(CC) $(CFLAGS) -c hilite.c
  62. util$(O): util.c
  63. $(CC) $(CFLAGS) -c util.c
  64. shell$(O): shell.c
  65. $(CC) $(CFLAGS) -c shell.c
  66. main$(O): main.c
  67. $(CC) $(CFLAGS) -c main.c
  68. clean:
  69. -$(RM) $(OBJ) ait$(E)
  70. ifeq ($(LSP), yes)
  71. install: install-lsp
  72. else
  73. install:
  74. endif
  75. -$(IN) -m755 ait$(E) $(INSTALLDIR)
  76. -$(IN) -m644 ait.1 $(MANDIR)
  77. install-lsp:
  78. -$(MKDIR) $(SHAREDIR)ait
  79. -$(AWK) -vdir="$(SHAREDIR)ait" -f replace-share.awk \
  80. scripts/lsp$(OR) > scripts/lsp$(E)
  81. -$(AWK) -vdir="$(SHAREDIR)ait" -f replace-share.awk \
  82. scripts/lsp-server$(OR) > scripts/lsp-server$(E)
  83. -$(IN) -m755 scripts/lsp-server$(L) $(SHAREDIR)ait/
  84. -$(IN) -m755 scripts/lsp-extract$(L) $(SHAREDIR)ait/
  85. -$(IN) -m755 scripts/lsp$(E) $(INSTALLDIR)
  86. -$(IN) -m755 scripts/lsp-server$(E) $(INSTALLDIR)
  87. uninstall:
  88. -$(RM) $(INSTALLDIR)ait$(E)
  89. -$(RM) $(MANDIR)ait.1
  90. -$(RM) -rf $(SHAREDIR)ait