1
0
mirror of https://git.sr.ht/~sircmpwn/gmni synced 2024-11-23 04:51:59 +01:00
gmni/Makefile
2020-09-23 09:12:48 -04:00

48 lines
1012 B
Makefile

.POSIX:
.SUFFIXES:
OUTDIR=.build
include $(OUTDIR)/config.mk
include $(OUTDIR)/cppcache
gmni: $(gmni_objects)
@printf 'CCLD\t$@\n'
@$(CC) $(LDFLAGS) -o $@ $(gmni_objects) $(LIBS)
gmnlm: $(gmnlm_objects)
@printf 'CCLD\t$@\n'
@$(CC) $(LDFLAGS) -o $@ $(gmnlm_objects) $(LIBS)
doc/gmni.1: doc/gmni.scd
doc/gmnlm.1: doc/gmnlm.scd
.SUFFIXES: .c .o .scd .1
.c.o:
@printf 'CC\t$@\n'
@touch $(OUTDIR)/cppcache
@grep $< $(OUTDIR)/cppcache >/dev/null || \
$(CPP) $(CFLAGS) -MM -MT $@ $< >> $(OUTDIR)/cppcache
@$(CC) -c $(CFLAGS) -o $@ $<
.scd.1:
@printf 'SCDOC\t$@\n'
@$(SCDOC) < $< > $@
docs: doc/gmni.1 doc/gmnlm.1
clean:
@rm -f gmni doc/gmni.1 doc/gmnlm.1 $(gmnlm_objects) $(gmni_objects)
distclean: clean
@rm -rf "$(OUTDIR)"
install: all
mkdir -p $(BINDIR)
mkdir -p $(MANDIR)/man1
install -Dm755 gmni $(BINDIR)/gmni
install -Dm755 gmnlm $(BINDIR)/gmnlm
install -Dm644 doc/gmni.1 $(MANDIR)/man1/gmni.1
install -Dm644 doc/gmnlm.1 $(MANDIR)/man1/gmnlm.1
.PHONY: clean distclean docs install