summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAaron Ball <nullspoon@oper.io>2019-11-24 17:41:25 -0700
committerAaron Ball <nullspoon@oper.io>2019-12-07 16:50:48 -0700
commit14796c47e931b5adee7e0e01d7ecab86498a2eab (patch)
tree1bef8ff762753c9197e871e33be39617f109d9fc /Makefile
parenta0656f00381bc3b900008bc05e7c6fab158a96bf (diff)
downloadoper.io-14796c47e931b5adee7e0e01d7ecab86498a2eab.tar.gz
oper.io-14796c47e931b5adee7e0e01d7ecab86498a2eab.tar.xz
Initial commit of CGI conversion
This introduces the C code that will build out the index rendering cgi program. It supports three query string keys, 404 pages, and printing of requestor ip (?q=ip) and user agent (?q=agent). Remove index.php and info.php. These are no longer needed as their functionality is replaced by the new CGI program. Makefile:add src and clean targets to build the source and clean up build artifacts, respectively. Add header and footer j2 files to replace the old header and footer php files. Deleted old php variants.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 15 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index e8f2406..d464c3e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,8 @@
+CCOPTS = --std=gnu99 -Wall
+.PHONY: src
+
all:
- $(error Must specify a target (adoc or rst))
+ $(error Must specify a target (adoc, rst, or src))
validate:
ifndef SRC
@@ -20,3 +23,14 @@ rst: validate
rst2html5.py \
--initial-header-level=2 \
--template "res/rst_template.txt" "$(SRC)" "$(DEST)"
+
+src:
+ if [ ! -d obj ]; then mkdir obj; fi
+ cc $(CCOPTS) src/common.c -c -o obj/common.o
+ cc $(CCOPTS) src/cgi.c -c -o obj/cgi.o
+ cc $(CCOPTS) src/j2.c -c -o obj/j2.o
+ cc $(CCOPTS) src/main.c obj/*.o -o index
+
+clean:
+ if [ -d obj ]; then rm -r obj/*; fi
+ rm -f index

Generated by cgit