123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- #
- # GNUmakefile
- #
- # Based on Anthonys Editor January 93
- #
- # Public Domain 1991, 1993 by Anthony Howe. No warranty.
- # BSD 3-Clause 2023-2024 by Kevin Bloom.
- #
- LSP ?= no
- OPSYS := $(shell uname -s)
- ifeq ($(OPSYS), Darwin)
- PREFIX ?= /usr/local
- SPACER ?= share/
- else ifeq ($(OPSYS), Linux)
- PREFIX ?= /usr/local
- else
- PREFIX ?= /usr/pkg
- endif
- DESTDIR ?=
- INSTALLDIR ?= $(DESTDIR)$(PREFIX)/bin/
- SHAREDIR ?= $(DESTDIR)$(PREFIX)/share/
- MANDIR ?= $(DESTDIR)$(PREFIX)/$(SPACER)man/man1/
- CC = cc
- CFLAGS = -g -O3 -Wall
- LD = cc
- LDFLAGS =
- CP = cp
- MV = mv
- RM = rm
- IN = install
- MKDIR = mkdir
- AWK = awk
- E =
- O = .o
- H = .h
- L = .lua
- OR = .orig
- 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)
- all: ait$(E)
- ait$(E) : $(OBJ)
- $(LD) $(LDFLAGS) -o ait$(E) $(OBJ) $(LIBS)
- command$(O): command.c
- $(CC) $(CFLAGS) -c command.c
- complete$(O): complete.c
- $(CC) $(CFLAGS) -c complete.c
- display$(O): display.c
- $(CC) $(CFLAGS) -c display.c
- gap$(O): gap.c
- $(CC) $(CFLAGS) -c gap.c
- key$(O): key.c
- $(CC) $(CFLAGS) -c key.c
- search$(O): search.c
- $(CC) $(CFLAGS) -c search.c
- replace$(O): replace.c
- $(CC) $(CFLAGS) -c replace.c
- window$(O): window.c
- $(CC) $(CFLAGS) -c window.c
- buffer$(O): buffer.c
- $(CC) $(CFLAGS) -c buffer.c
- hilite$(O): hilite.c
- $(CC) $(CFLAGS) -c hilite.c
- util$(O): util.c
- $(CC) $(CFLAGS) -c util.c
- shell$(O): shell.c
- $(CC) $(CFLAGS) -c shell.c
- main$(O): main.c
- $(CC) $(CFLAGS) -c main.c
- clean:
- -$(RM) $(OBJ) ait$(E)
- ifeq ($(LSP), yes)
- install: install-lsp
- else
- install:
- endif
- -$(IN) -m755 ait$(E) $(INSTALLDIR)
- -$(IN) -m644 ait.1 $(MANDIR)
- install-lsp:
- -$(MKDIR) $(SHAREDIR)ait
- -$(AWK) -vdir="$(SHAREDIR)ait" -f replace-share.awk \
- scripts/lsp$(OR) > scripts/lsp$(E)
- -$(AWK) -vdir="$(SHAREDIR)ait" -f replace-share.awk \
- scripts/lsp-server$(OR) > scripts/lsp-server$(E)
- -$(IN) -m755 scripts/lsp-server$(L) $(SHAREDIR)ait/
- -$(IN) -m755 scripts/lsp-extract$(L) $(SHAREDIR)ait/
- -$(IN) -m755 scripts/lsp$(E) $(INSTALLDIR)
- -$(IN) -m755 scripts/lsp-server$(E) $(INSTALLDIR)
- uninstall:
- -$(RM) $(INSTALLDIR)ait$(E)
- -$(RM) $(MANDIR)ait.1
- -$(RM) -rf $(SHAREDIR)ait
|