2020-09-20 16:17:39 +02:00
|
|
|
.POSIX:
|
|
|
|
.SUFFIXES:
|
|
|
|
OUTDIR=.build
|
|
|
|
include $(OUTDIR)/config.mk
|
|
|
|
include $(OUTDIR)/cppcache
|
|
|
|
|
2020-09-20 20:51:25 +02:00
|
|
|
gmni: $(gmni_objects)
|
2020-09-20 16:17:39 +02:00
|
|
|
@printf 'CCLD\t$@\n'
|
2020-09-20 20:51:25 +02:00
|
|
|
@$(CC) $(LDFLAGS) $(LIBS) -o $@ $(gmni_objects)
|
2020-09-20 16:17:39 +02:00
|
|
|
|
2020-09-21 00:31:33 +02:00
|
|
|
gmnlm: $(gmnlm_objects)
|
|
|
|
@printf 'CCLD\t$@\n'
|
|
|
|
@$(CC) $(LDFLAGS) $(LIBS) -o $@ $(gmnlm_objects)
|
|
|
|
|
2020-09-20 20:51:25 +02:00
|
|
|
doc/gmni.1: doc/gmni.scd
|
2020-09-21 04:37:44 +02:00
|
|
|
doc/gmnlm.1: doc/gmnlm.scd
|
2020-09-20 20:44:30 +02:00
|
|
|
|
|
|
|
.SUFFIXES: .c .o .scd .1
|
2020-09-20 16:17:39 +02:00
|
|
|
|
|
|
|
.c.o:
|
|
|
|
@printf 'CC\t$@\n'
|
|
|
|
@touch $(OUTDIR)/cppcache
|
|
|
|
@grep $< $(OUTDIR)/cppcache >/dev/null || \
|
|
|
|
$(CPP) $(CFLAGS) -MM -MT $@ $< >> $(OUTDIR)/cppcache
|
|
|
|
@$(CC) -c $(CFLAGS) -o $@ $<
|
|
|
|
|
2020-09-20 20:44:30 +02:00
|
|
|
.scd.1:
|
|
|
|
@printf 'SCDOC\t$@\n'
|
|
|
|
@$(SCDOC) < $< > $@
|
|
|
|
|
2020-09-21 04:37:44 +02:00
|
|
|
docs: doc/gmni.1 doc/gmnlm.1
|
2020-09-20 20:44:30 +02:00
|
|
|
|
2020-09-20 16:17:39 +02:00
|
|
|
clean:
|
2020-09-21 04:37:44 +02:00
|
|
|
@rm -f gmni doc/gmni.1 doc/gmnlm.1
|
2020-09-20 16:17:39 +02:00
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
@rm -rf "$(OUTDIR)"
|
|
|
|
|
2020-09-20 20:55:33 +02:00
|
|
|
install: all
|
|
|
|
mkdir -p $(BINDIR)
|
|
|
|
mkdir -p $(MANDIR)/man1
|
|
|
|
install -Dm755 gmni $(BINDIR)/gmni
|
2020-09-21 04:37:44 +02:00
|
|
|
install -Dm755 gmnlm $(BINDIR)/gmnlm
|
2020-09-20 20:55:33 +02:00
|
|
|
install -Dm644 doc/gmni.1 $(MANDIR)/man1/gmni.1
|
2020-09-21 04:37:44 +02:00
|
|
|
install -Dm644 doc/gmnlm.1 $(MANDIR)/man1/gmnlm.1
|
2020-09-20 20:55:33 +02:00
|
|
|
|
|
|
|
.PHONY: clean distclean docs install
|