.PHONY: regress regress_rebuild .SUFFIXES: .xml .html .1.html .1 .md .dot .svg include Makefile.configure WWWDIR = /var/www/vhosts/kristaps.bsd.lv/htdocs/sblg sinclude Makefile.local VERSION = 0.6.1 OBJS = compats.o \ main.o \ compile.o \ linkall.o \ grok.o \ util.o \ atom.o \ article.o \ json.o \ listtags.o SRCS = compats.c \ main.c \ compile.c \ linkall.c \ grok.c \ util.c \ atom.c \ article.c \ json.c \ listtags.c \ tests.c XMLS = versions.xml ATOM = atom.xml HTMLS = archive.html \ example1.html \ example2.html \ example3.html \ index.html \ sblg.1.html CSSS = article.css \ index.css DATADIR = $(SHAREDIR)/sblg EXAMPLEDIR = $(DATADIR)/examples DOTAR = Makefile \ $(SRCS) \ sblg.in.1 \ sblg.h \ schema.json \ extern.h \ article.css \ article.xml \ article1.xml \ article2.xml \ article4.xml \ article5.xml \ article6.xml \ article7.xml \ article8.xml \ article9.xml \ article10.md BUILT = article10.xml \ index1.svg \ index2.svg \ index3.svg \ index4.svg IMAGES = template1.jpg \ template2.jpg \ template3.jpg \ template4.jpg \ template5.jpg \ template6.jpg ARTICLES = article1.html \ article2.html \ article4.html \ article5.html \ article6.html \ article7.html \ article8.html \ article9.html \ article10.html LDADD_PKG != pkg-config --libs expat 2>/dev/null || echo "-lexpat" CFLAGS_PKG != pkg-config --cflags expat 2>/dev/null || echo "" LDADD += $(LDADD_PKG) CFLAGS += $(CFLAGS_PKG) # If this command not found, the JSON test is skipped. JQ = jq VALGRIND = valgrind VALGRIND_ARGS = -q --leak-check=full --leak-resolution=high --show-reachable=yes REGRESS_ENV = TZ=GMT LC_ALL=en_US all: sblg sblg.a sblg.1 sblg: $(OBJS) $(CC) -o $@ $(OBJS) $(LDFLAGS) $(LDADD) sblg.a: $(OBJS) $(AR) rs $@ $(OBJS) www: $(HTMLS) $(ARTICLES) $(BUILT) $(ATOM) sblg.tar.gz sblg.tar.gz.sha512 sblg ( cd examples/simple && $(MAKE) SBLG=../../sblg ) ( cd examples/simple-frontpage && $(MAKE) SBLG=../../sblg ) ( cd examples/retro && $(MAKE) SBLG=../../sblg ) ( cd examples/brutalist && $(MAKE) SBLG=../../sblg ) ( cd examples/photos-column && $(MAKE) SBLG=../../sblg ) ( cd examples/photos-grid && $(MAKE) SBLG=../../sblg ) sblg.1: sblg.in.1 sed "s!@SHAREDIR@!$(DATADIR)!g" sblg.in.1 >$@ installwww: www mkdir -p $(WWWDIR) mkdir -p $(WWWDIR)/snapshots install -m 0444 Makefile $(BUILT) $(IMAGES) $(ATOM) $(HTMLS) $(CSSS) $(ARTICLES) $(WWWDIR) install -m 0444 sblg.tar.gz $(WWWDIR)/snapshots/sblg-$(VERSION).tar.gz install -m 0444 sblg.tar.gz.sha512 $(WWWDIR)/snapshots/sblg-$(VERSION).tar.gz.sha512 install -m 0444 sblg.tar.gz $(WWWDIR)/snapshots install -m 0444 sblg.tar.gz.sha512 $(WWWDIR)/snapshots ( cd examples/simple && $(MAKE) installwww SBLG=../../sblg WWWDIR=$(WWWDIR)/examples/simple ) ( cd examples/simple-frontpage && $(MAKE) installwww SBLG=../../sblg WWWDIR=$(WWWDIR)/examples/simple-frontpage ) ( cd examples/retro && $(MAKE) installwww SBLG=../../sblg WWWDIR=$(WWWDIR)/examples/retro ) ( cd examples/brutalist && $(MAKE) installwww SBLG=../../sblg WWWDIR=$(WWWDIR)/examples/brutalist ) ( cd examples/photos-column && $(MAKE) installwww SBLG=../../sblg WWWDIR=$(WWWDIR)/examples/photos-column ) ( cd examples/photos-grid && $(MAKE) installwww SBLG=../../sblg WWWDIR=$(WWWDIR)/examples/photos-grid ) install: all mkdir -p $(DESTDIR)$(BINDIR) mkdir -p $(DESTDIR)$(DATADIR) mkdir -p $(DESTDIR)$(EXAMPLEDIR)/simple mkdir -p $(DESTDIR)$(EXAMPLEDIR)/simple-frontpage mkdir -p $(DESTDIR)$(EXAMPLEDIR)/retro mkdir -p $(DESTDIR)$(MANDIR)/man1 $(INSTALL_PROGRAM) sblg $(DESTDIR)$(BINDIR) $(INSTALL_MAN) sblg.1 $(DESTDIR)$(MANDIR)/man1 $(INSTALL_DATA) schema.json $(DESTDIR)$(DATADIR) ( cd examples/simple && $(MAKE) install PREFIX=$(DESTDIR)$(EXAMPLEDIR)/simple ) ( cd examples/simple-frontpage && $(MAKE) install PREFIX=$(DESTDIR)$(EXAMPLEDIR)/simple-frontpage ) ( cd examples/retro && $(MAKE) install PREFIX=$(DESTDIR)$(EXAMPLEDIR)/retro ) ( cd examples/brutalist && $(MAKE) install PREFIX=$(DESTDIR)$(EXAMPLEDIR)/brutalist ) ( cd examples/photos-column && $(MAKE) install PREFIX=$(DESTDIR)$(EXAMPLEDIR)/photos-column ) ( cd examples/photos-grid && $(MAKE) install PREFIX=$(DESTDIR)$(EXAMPLEDIR)/photos-grid ) sblg.tar.gz: mkdir -p .dist/sblg-$(VERSION)/ install -m 0644 $(DOTAR) .dist/sblg-$(VERSION) install -m 0755 configure .dist/sblg-$(VERSION) mkdir -p .dist/sblg-$(VERSION)/examples/retro mkdir -p .dist/sblg-$(VERSION)/examples/brutalist mkdir -p .dist/sblg-$(VERSION)/examples/photos-column mkdir -p .dist/sblg-$(VERSION)/examples/photos-grid mkdir -p .dist/sblg-$(VERSION)/examples/simple-frontpage ( cd examples/simple && $(MAKE) install PREFIX=../../.dist/sblg-$(VERSION)/examples/simple ) ( cd examples/simple-frontpage && $(MAKE) install PREFIX=../../.dist/sblg-$(VERSION)/examples/simple-frontpage ) ( cd examples/retro && $(MAKE) install PREFIX=../../.dist/sblg-$(VERSION)/examples/retro ) ( cd examples/brutalist && $(MAKE) install PREFIX=../../.dist/sblg-$(VERSION)/examples/brutalist ) ( cd examples/photos-column && $(MAKE) install PREFIX=../../.dist/sblg-$(VERSION)/examples/photos-column ) ( cd examples/photos-grid && $(MAKE) install PREFIX=../../.dist/sblg-$(VERSION)/examples/photos-grid ) mkdir -p .dist/sblg-$(VERSION)/regress mkdir -p .dist/sblg-$(VERSION)/regress/standalone mkdir -p .dist/sblg-$(VERSION)/regress/blog mkdir -p .dist/sblg-$(VERSION)/regress/json install -m 0644 regress/standalone/*.html regress/standalone/*.xml .dist/sblg-$(VERSION)/regress/standalone install -m 0644 regress/blog/*.html regress/blog/*.xml .dist/sblg-$(VERSION)/regress/blog install -m 0644 regress/json/*.xml regress/json/*.json .dist/sblg-$(VERSION)/regress/json ( cd .dist/ && tar zcf ../$@ ./ ) rm -rf .dist/ sblg.tar.gz.sha512: sblg.tar.gz openssl dgst -sha512 -hex sblg.tar.gz >$@ distcheck: sblg.tar.gz.sha512 mandoc -Tlint -Werror sblg.in.1 newest=`grep "