1
0
forked from aniani/gmnisrv
gmnisrv/Makefile

51 lines
1.1 KiB
Makefile
Raw Normal View History

2020-09-23 10:21:44 -04:00
.POSIX:
.SUFFIXES:
OUTDIR=.build
include $(OUTDIR)/config.mk
include $(OUTDIR)/cppcache
gmnisrv: $(gmnisrv_objects)
@printf 'CCLD\t$@\n'
@$(CC) $(LDFLAGS) -o $@ $(gmnisrv_objects) $(LIBS)
2020-09-26 16:43:34 -04:00
doc/gmnisrv.1: doc/gmnisrv.scd
doc/gmnisrvini.5: doc/gmnisrvini.scd
.SUFFIXES: .c .o .scd .1 .5
2020-09-23 10:21:44 -04: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 $@ $<
.scd.1:
@printf 'SCDOC\t$@\n'
@$(SCDOC) < $< > $@
2020-09-26 16:43:34 -04:00
.scd.5:
@printf 'SCDOC\t$@\n'
@$(SCDOC) < $< > $@
docs: doc/gmnisrv.1 doc/gmnisrvini.5
2020-09-23 10:21:44 -04:00
clean:
2020-09-26 16:43:34 -04:00
@rm -f gmnisrv $(gmnisrv_objects) doc/*.1 doc/*.5
2020-09-23 10:21:44 -04:00
distclean: clean
@rm -rf "$(OUTDIR)"
install: all
2020-09-26 16:43:34 -04:00
mkdir -p \
$(DESTDIR)$(BINDIR) \
$(DESTDIR)$(SHAREDIR)/gmnisrv \
$(DESTDIR)$(MANDIR)/man5 \
$(DESTDIR)$(MANDIR)/man1
2020-09-23 11:19:29 -04:00
install -Dm755 gmnisrv $(DESTDIR)$(BINDIR)/gmnisrv
2020-09-26 16:43:34 -04:00
install -Dm644 $(SRCDIR)/config.ini $(DESTDIR)$(SHAREDIR)/gmnisrv/gmnisrv.ini
install -Dm644 doc/gmnisrv.1 $(DESTDIR)$(MANDIR)/man1/gmnisrv.1
install -Dm644 doc/gmnisrvini.5 $(DESTDIR)$(MANDIR)/man5/gmnisrv.ini.5
2020-09-23 10:21:44 -04:00
.PHONY: clean distclean docs install