From: Not Zed Date: Thu, 2 May 2019 22:41:18 +0000 (+0930) Subject: Made the binary names configurable. X-Git-Url: https://code.zedzone.au/cvs?a=commitdiff_plain;h=faf8c0e58d018a8527f2c38ee43741f57b2a1b49;p=blogz Made the binary names configurable. Fixed some errors in the Makefile. Fixed url path bugs in generator. --- diff --git a/Makefile b/Makefile index 482cf2b..839e8c9 100644 --- a/Makefile +++ b/Makefile @@ -19,27 +19,27 @@ # see config.h for application level config, config.make is created from it include config.make -CPPFLAGS=-I../libeze +CPPFLAGS= CFLAGS=-Og -g -Wall -Wno-unused-function $(DEBUG_CFLAGS) -LDLIBS=-L../libeze -leze +LDLIBS= 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 \ @@ -74,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): @@ -130,6 +132,3 @@ config.make: config.h Makefile ifeq (,$(filter clean install-db dist,$(MAKECMDGOALS))) -include $(patsubst %.c,.deps/%.d,$(built_SRCS)) endif - -articledb: articledb.o - $(CC) -o $@ $^ -llmdb ../libeze/libeze.a 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