Your first Kore module worked.
+diff --git a/example.conf b/example.conf index 1bc6c1e..35b766f 100644 --- a/example.conf +++ b/example.conf @@ -4,9 +4,9 @@ bind 10.211.55.3 443 # Load our site module now (containing all the goodies). -load ../betrippin/betrippin.module +load example/example.module # Declare page handlers below. # handler path module_callback -static /css/main.css betrippin_serve_style_css +static /css/style.css betrippin_serve_style_css static / betrippin_serve_index diff --git a/example/Makefile b/example/Makefile new file mode 100644 index 0000000..fe31d1d --- /dev/null +++ b/example/Makefile @@ -0,0 +1,49 @@ +# Example Kore module + +.SUFFIXES: .html .css + +CC=gcc +BIN=example.module + +HTML= html/index.html +H_SRCS= $(HTML:.html=.c) + +CSS= css/style.css +C_SRCS= $(CSS:.css=.c) + +S_SRC= src/example.c $(H_SRCS) $(C_SRCS) +S_OBJS= $(S_SRC:.c=.o) + +CFLAGS+=-I. -I../includes +CFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes +CFLAGS+=-Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual +CFLAGS+=-Wsign-compare -g +LDFLAGS+=-shared + +all: + make clean + make example.module + +example.module: html_inject $(H_SRCS) $(C_SRCS) $(S_OBJS) + $(CC) $(LDFLAGS) $(S_OBJS) -o $(BIN) + make clean_o + +html_inject: tools/html_inject.c + $(CC) $(CFLAGS) tools/html_inject.c -o tools/html_inject + +.html.c: + tools/html_inject $< `basename $<` > $@ + +.css.c: + tools/html_inject $< `basename $<` > $@ + +.c.o: $< + $(CC) -fPIC $(CFLAGS) -c $< -o $@ + +clean: + make clean_o + rm -f css/*.c html/*.c tools/html_inject $(BIN) + rm -f static.h + +clean_o: + rm -f css/*.o html/*.o src/*.o diff --git a/example/css/style.css b/example/css/style.css new file mode 100644 index 0000000..f8b3425 --- /dev/null +++ b/example/css/style.css @@ -0,0 +1,16 @@ +body { + width: 100%; + margin: 0px; + color: #000; + overflow: hidden; + background-color: #fff; +} + +.content { + width: 800px; + margin-left: auto; + margin-right: auto; + margin-top: 100px; + font-size: 60px; + text-align: center; +} diff --git a/example/html/index.html b/example/html/index.html new file mode 100644 index 0000000..bf8b7d7 --- /dev/null +++ b/example/html/index.html @@ -0,0 +1,14 @@ + +
+ +Your first Kore module worked.
+