split the example in its own directory and build libgcgi.a - libgcgi - REST lib… | |
git clone git://bitreich.org/libgcgi git://hg6vgqziawt5s4dj.onion/libgcgi | |
Log | |
Files | |
Refs | |
Tags | |
README | |
LICENSE | |
--- | |
commit d95300e6a57bb44417aa2ea8051cfeb3729e84c4 | |
parent d0bfec3b39e68a034364d01e1bdb4d37d605b839 | |
Author: Josuah Demangeon <[email protected]> | |
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(-) | |
--- | |
diff --git a/.gitignore b/.gitignore | |
@@ -1 +1,3 @@ | |
index.cgi | |
+*.o | |
+*.a | |
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 -… | |
+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 $@ $< | |
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 -W… | |
+ | |
+all: index.cgi | |
+ | |
+clean: | |
+ rm -f index.cgi | |
+ | |
+index.cgi: index.c | |
+ ${CC} ${LDFLAGS} ${CFLAGS} -o $@ index.c ${LIBS} | |
diff --git a/db/vars b/example/db/vars | |
diff --git a/gph/page_not_found.gph b/example/gph/page_not_found.gph | |
diff --git a/index.c b/example/index.c |