2022-02-03 20:28:47 +00:00
|
|
|
OBJDIR = .obj
|
|
|
|
PREFIX = /usr/local
|
|
|
|
CFLAGS = \
|
|
|
|
-Os -g \
|
|
|
|
-DNON_CORRECTING \
|
|
|
|
-DLIBDIR=\"$(PREFIX)/share/LLgen/\"
|
|
|
|
|
|
|
|
SRCS = \
|
|
|
|
src/alloc.c \
|
|
|
|
src/cclass.c \
|
|
|
|
src/check.c \
|
|
|
|
src/compute.c \
|
|
|
|
src/gencode.c \
|
|
|
|
src/global.c \
|
|
|
|
src/LLgen.c \
|
|
|
|
src/Lpars.c \
|
|
|
|
src/machdep.c \
|
|
|
|
src/main.c \
|
|
|
|
src/name.c \
|
|
|
|
src/reach.c \
|
|
|
|
src/savegram.c \
|
|
|
|
src/sets.c \
|
|
|
|
src/tokens.c
|
|
|
|
|
2022-02-03 20:40:49 +00:00
|
|
|
DOCS = \
|
|
|
|
doc/LLgen.n \
|
|
|
|
doc/LLgen_NCER.n \
|
|
|
|
|
2022-02-03 20:28:47 +00:00
|
|
|
OBJS = $(patsubst %.c, $(OBJDIR)/%.o, $(SRCS))
|
|
|
|
DEPS = $(patsubst %.c, $(OBJDIR)/%.d, $(SRCS))
|
2022-02-03 20:40:49 +00:00
|
|
|
PDFS = $(patsubst doc/%.n, $(OBJDIR)/%.pdf, $(DOCS))
|
2022-02-05 19:50:49 +00:00
|
|
|
HTMLS = $(patsubst doc/%.n, $(OBJDIR)/%/index.html, $(DOCS))
|
2022-02-03 20:40:49 +00:00
|
|
|
|
|
|
|
all: LLgen doc
|
2022-02-03 20:28:47 +00:00
|
|
|
|
|
|
|
LLgen: $(OBJS)
|
|
|
|
$(CC) $(CFLAGS) -o $@ $(OBJS)
|
|
|
|
|
|
|
|
$(OBJDIR)/%.o: %.c
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(CC) $(CFLAGS) -MMD -c -o $@ $<
|
|
|
|
|
|
|
|
$(OBJDIR)/%.pdf: doc/%.n doc/LLgen.refs
|
2022-02-03 20:40:49 +00:00
|
|
|
@mkdir -p $(dir $@)
|
2022-02-05 21:48:14 +00:00
|
|
|
refer -p doc/LLgen.refs $< | groff -G -e -g -p -ms -Tpdf $< > $@
|
2022-02-03 20:40:49 +00:00
|
|
|
|
2022-02-05 19:50:49 +00:00
|
|
|
$(OBJDIR)/%/index.html: doc/%.n doc/LLgen.refs
|
|
|
|
@mkdir -p $(dir $@)
|
2022-02-05 21:48:14 +00:00
|
|
|
(cd $(dir $@) && refer -p $(PWD)/doc/LLgen.refs | groff -G -e -g -p -ms -Thtml) < $< > $@
|
2022-02-05 19:50:49 +00:00
|
|
|
|
|
|
|
doc:: $(PDFS) $(HTMLS)
|
2022-02-03 20:28:47 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf $(OBJDIR)
|
|
|
|
|
2022-02-05 19:50:49 +00:00
|
|
|
install: LLgen doc/LLgen.1 $(PDFS) $(HTMLS) $(wildcard lib/*)
|
2022-02-03 20:40:49 +00:00
|
|
|
install -D -s LLgen -t $(PREFIX)/bin
|
|
|
|
install -D doc/LLgen.1 -t $(PREFIX)/man/man1
|
|
|
|
install -D $(OBJDIR)/LLgen.pdf -t $(PREFIX)/doc/LLgen
|
|
|
|
install -D $(OBJDIR)/LLgen_NCER.pdf -t $(PREFIX)/doc/LLgen
|
2022-02-03 20:28:47 +00:00
|
|
|
install -D $(wildcard lib/*) -t $(PREFIX)/share/LLgen
|
|
|
|
|
|
|
|
-include $(DEPS)
|
|
|
|
|