split the example in its own directory and build libgcgi.a - libgcgi - REST library for Gopher HTML git clone git://bitreich.org/libgcgi git://hg6vgqziawt5s4dj.onion/libgcgi DIR Log DIR Files DIR Refs DIR Tags DIR README DIR LICENSE --- DIR commit d95300e6a57bb44417aa2ea8051cfeb3729e84c4 DIR parent d0bfec3b39e68a034364d01e1bdb4d37d605b839 HTML Author: Josuah Demangeon <me@josuah.net> Date: Thu, 4 Aug 2022 00:31:41 +0200 split the example in its own directory and build libgcgi.a Diffstat: M .gitignore | 2 ++ M Makefile | 20 +++++++++++++------- A example/Makefile | 11 +++++++++++ R db/vars -> example/db/vars | 0 R gph/page_not_found.gph -> example/… | 0 R index.c -> example/index.c | 0 6 files changed, 26 insertions(+), 7 deletions(-) --- DIR diff --git a/.gitignore b/.gitignore @@ -1 +1,3 @@ index.cgi +*.o +*.a DIR diff --git a/Makefile b/Makefile @@ -1,14 +1,20 @@ -LDFLAGS = -#LIBS = -lseccomp #<- uncomment on Linux -CFLAGS = -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE -g -pedantic -std=c99 -Wall -Wextra +CFLAGS = -D_POSIX_C_SOURCE=200809L -g -pedantic -std=c99 -Wall -Wextra +PREFIX = /usr/local +MANPREFIX = ${PREFIX}/share/man -all: index.cgi +all: libgcgi.a clean: - rm -f *.o index.cgi + rm -f *.o *.a + +install: + mkdir -p "${MANPREFIX}/man3" "${PREFIX}/lib" "${PREFIX}/include" + cp libgcgi.3 "${MANPREFIX}/man3" + cp libgcgi.a "${PREFIX}/lib" + cp libgcgi.h "${PREFIX}/include" README: libgcgi.3 mandoc -Tutf8 libgcgi.3 | col -bx | sed '1h; $$g' >$@ -index.cgi: index.c libgcgi.c libgcgi.h - ${CC} ${LDFLAGS} ${CFLAGS} -o $@ index.c libgcgi.c ${LIBS} +.o.a: + ar rsv $@ $< DIR diff --git a/example/Makefile b/example/Makefile @@ -0,0 +1,11 @@ +LIBS = -lgcgi #-lseccomp #<- uncomment on Linux +LDFLAGS = -L.. +CFLAGS = -I.. -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE -g -pedantic -std=c99 -Wall -Wextra + +all: index.cgi + +clean: + rm -f index.cgi + +index.cgi: index.c + ${CC} ${LDFLAGS} ${CFLAGS} -o $@ index.c ${LIBS} DIR diff --git a/db/vars b/example/db/vars DIR diff --git a/gph/page_not_found.gph b/example/gph/page_not_found.gph DIR diff --git a/index.c b/example/index.c