unroff/src/Makefile

91 lines
1.7 KiB
Makefile
Raw Normal View History

PREFIX = $$HOME/.local
BINDIR = $(PREFIX)/bin
DATADIR = $(PREFIX)/share
2023-02-13 08:45:50 -05:00
ELK_INCLUDE_DIR = $(PREFIX)/include
ELK_LIB_DIR = $(PREFIX)/lib
2023-02-13 08:45:50 -05:00
CTAGS = ctags -t -w
INSTALL = install
MAKEDEPEND = makedepend
2023-02-13 08:45:50 -05:00
CC = gcc
CFLAGS = -Wall -pedantic -O -I $(ELK_INCLUDE_DIR)
LDFLAGS = -L $(ELK_LIB_DIR) -lm -lelk
2023-02-13 08:45:50 -05:00
### The directory under which you will install the Scheme files.
DEFAULT_DIR = $(DATADIR)/unroff
SCMDIR = $(DATADIR)/unroff/scm
2023-02-13 08:45:50 -05:00
DEFAULT_FORMAT = html
2023-02-13 08:45:50 -05:00
INCLUDE = -I $(ELK_INCLUDE_DIR)
DEFS = -D DEFAULT_DIR=\"$(DEFAULT_DIR)\" -D DEFAULT_FORMAT=\"$(DEFAULT_FORMAT)\"
2023-02-13 08:45:50 -05:00
SOURCES = \
args.c\
buffer.c\
error.c\
event.c\
expr.c\
gcroot.c\
insert.c\
malloc.c\
parse.c\
prim.c\
scmtable.c\
stream.c\
subst.c\
table.c\
unroff.c
OBJECTS = \
args.o\
buffer.o\
error.o\
event.o\
expr.o\
gcroot.o\
insert.o\
malloc.o\
parse.o\
prim.o\
scmtable.o\
stream.o\
subst.o\
table.o\
unroff.o
2023-02-13 08:45:50 -05:00
all: unroff
2023-02-13 08:45:50 -05:00
unroff: $(OBJECTS)
2023-02-25 04:43:09 -05:00
$(CC) -o $@ $(OBJECTS) $(LDFLAGS)
2023-02-13 08:45:50 -05:00
.c.o:
$(CC) $(CFLAGS) $(INCLUDE) $(DEFS) -c $<
install: unroff
$(INSTALL) unroff $(BINDIR)/unroff
mkdir -p $(SCMDIR)
mkdir -p $(SCMDIR)/html
mkdir -p $(SCMDIR)/misc
$(INSTALL) -m 644 ../scm/html/common.scm $(SCMDIR)/html/common.scm
$(INSTALL) -m 644 ../scm/html/m.scm $(SCMDIR)/html/m.scm
$(INSTALL) -m 644 ../scm/html/man.scm $(SCMDIR)/html/man.scm
$(INSTALL) -m 644 ../scm/html/ms.scm $(SCMDIR)/html/ms.scm
$(INSTALL) -m 644 ../scm/misc/hyper.scm $(SCMDIR)/misc/hyper.scm
$(INSTALL) -m 644 ../scm/troff.scm $(SCMDIR)/troff.scm
2023-02-13 08:45:50 -05:00
clean:
rm -f $(OBJECTS) unroff
2023-02-13 08:45:50 -05:00
tags ctags: $(SOURCES)
2023-02-13 08:45:50 -05:00
$(CTAGS) $(SOURCES)
depend: Makefile $(SOURCES)
$(MAKEDEPEND) $(INCLUDE) $(SOURCES)
2023-02-13 08:45:50 -05:00
.PHONY: all clean ctags depend install tags
2023-02-13 08:45:50 -05:00
# DO NOT DELETE THIS LINE -- make depend depends on it.