From f6b9925e87aa42158f06198b855184f19f4b2322 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Fri, 3 May 2019 08:37:23 +0930 Subject: [PATCH] Apply fixes from trunk. Fix script paths missing from config.h.in Makefile fixes Binary names are configurable Fix script paths used in posts. --- Makefile | 16 ++++++++++------ blog.c | 8 ++++---- config.h.in | 17 +++++++++-------- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 22f13c0..839e8c9 100644 --- a/Makefile +++ b/Makefile @@ -19,25 +19,27 @@ # see config.h for application level config, config.make is created from it include config.make +CPPFLAGS= CFLAGS=-Og -g -Wall -Wno-unused-function $(DEBUG_CFLAGS) +LDLIBS= -dist_VERSION=0.3 +dist_VERSION=0.3.99 tools=newpost -cgis=$(if $(USE_FCGI),blog.fcgi,blog.cgi) +cgis=$(if $(USE_FCGI),$(BLOGZ_FCGI),$(BLOGZ_CGI)) # these are the intermediate targets, not the sources blogz_TEMPLATES=blog-header.c blog-footer.c blogz_PROGRAMS= $(cgis) $(tools) -blog.fcgi_SRCS=blog.c posts.c $(blogz_TEMPLATES) blogio-fcgi.c fcgi.c -blog.cgi_SRCS=blog.c posts.c $(blogz_TEMPLATES) blogio-stdio.c +$(BLOGZ_FCGI)_SRCS=blog.c posts.c $(blogz_TEMPLATES) blogio-fcgi.c fcgi.c +$(BLOGZ_CGI)_SRCS=blog.c posts.c $(blogz_TEMPLATES) blogio-stdio.c newpost_SRCS=newpost.c built_SRCS=$(sort $(foreach prog,$(blogz_PROGRAMS),$($(prog)_SRCS))) -dist_PROGRAMS=blog.cgi blog.fcgi newpost +dist_PROGRAMS=$(BLOGZ_CGI) $(BLOGZ_FCGI) newpost dist_SRCS=$(sort $(foreach prog,$(dist_PROGRAMS),$($(prog)_SRCS))) dist_EXTRA=Makefile \ README COPYING \ @@ -72,11 +74,13 @@ blog-%.c: template/blog-%.html maketemplate.pl etag.h: posts-tables.h $(blogz_TEMPLATES) date --rfc-3339 ns | md5sum | awk '{ printf "static const char* etag = \"%s\";\n",$$1 }' > etag.h +blog.o: etag.h + clean: rm -f posts-tables.h $(blogz_TEMPLATES) config.make rm -f *.o rm -rf .deps - rm -f blog.cgi blog.fcgi + rm -f $(BLOGZ_CGI) $(BLOGZ_FCGI) rm -rf newpost $(DB_POST): diff --git a/blog.c b/blog.c index 4b787d7..4bea800 100644 --- a/blog.c +++ b/blog.c @@ -283,9 +283,9 @@ static void print_blog(const char *how, const char *path, postid_t *ids, int cou for (i=0;i