kore

An easy to use, scalable and secure web application framework for writing web APIs in C.
Commits | Files | Refs | README | LICENSE | git clone https://git.kore.io/kore.git

commit c5ce707a917dbe84bfdd3a8452479c2109e2f33e
parent 8282baf63dfee9c299bc7fcaf602cd00775496c1
Author: Joris Vink <joris@coders.se>
Date:   Wed, 27 Jan 2016 21:29:59 +0100

Introduce build flavors.

Kore applications now get a build.conf which may contain different
build flavors. Each flavor can get its own cflags or ldflags.

This was in parts inspired by #106.

A new cli command has been added:
kore flavor

This command allows you to see all flavors and switch between them.
The kore build command now also takes a -v argument which if given
dumps the used CFLAGS and LDFLAGS out to stdout.

For existing applications the build.conf is automatically generated
next time you run kore build or kore run.

Also fixed a bug in the json_yajl example, sneaky change here.

Diffstat:
examples/cpp/conf/build.conf | 18++++++++++++++++++
examples/generic/conf/build.conf | 18++++++++++++++++++
examples/headers/conf/build.conf | 18++++++++++++++++++
examples/integers/conf/build.conf | 18++++++++++++++++++
examples/json_yajl/conf/build.conf | 19+++++++++++++++++++
examples/ktunnel/conf/build.conf | 18++++++++++++++++++
examples/messaging/conf/build.conf | 18++++++++++++++++++
examples/nohttp/conf/build.conf | 18++++++++++++++++++
examples/parameters/conf/build.conf | 18++++++++++++++++++
examples/pgsql-sync/conf/build.conf | 18++++++++++++++++++
examples/pgsql/conf/build.conf | 18++++++++++++++++++
examples/pipe_task/conf/build.conf | 18++++++++++++++++++
examples/sse/conf/build.conf | 18++++++++++++++++++
examples/tasks/conf/build.conf | 19+++++++++++++++++++
examples/tls-proxy/conf/build.conf | 18++++++++++++++++++
examples/upload/conf/build.conf | 18++++++++++++++++++
examples/video_stream/conf/build.conf | 18++++++++++++++++++
examples/websocket/conf/build.conf | 18++++++++++++++++++
18 files changed, 326 insertions(+), 0 deletions(-)

diff --git a/examples/cpp/conf/build.conf b/examples/cpp/conf/build.conf @@ -0,0 +1,18 @@ +# cpp build config +# You can switch flavors using: kore flavor [newflavor] + +# The cflags below are shared between flavors +cflags=-Wall -Wmissing-declarations -Wshadow +cflags=-Wstrict-prototypes -Wmissing-prototypes +cflags=-Wpointer-arith -Wcast-qual -Wsign-compare + +dev { + # These cflags are added to the shared ones when + # you build the "dev" flavor. + cflags=-g +} + +#prod { +# You can specify additional CFLAGS here which are only +# included if you build with the "prod" flavor. +#} diff --git a/examples/generic/conf/build.conf b/examples/generic/conf/build.conf @@ -0,0 +1,18 @@ +# generic build config +# You can switch flavors using: kore flavor [newflavor] + +# The cflags below are shared between flavors +cflags=-Wall -Wmissing-declarations -Wshadow +cflags=-Wstrict-prototypes -Wmissing-prototypes +cflags=-Wpointer-arith -Wcast-qual -Wsign-compare + +dev { + # These cflags are added to the shared ones when + # you build the "dev" flavor. + cflags=-g +} + +#prod { +# You can specify additional CFLAGS here which are only +# included if you build with the "prod" flavor. +#} diff --git a/examples/headers/conf/build.conf b/examples/headers/conf/build.conf @@ -0,0 +1,18 @@ +# headers build config +# You can switch flavors using: kore flavor [newflavor] + +# The cflags below are shared between flavors +cflags=-Wall -Wmissing-declarations -Wshadow +cflags=-Wstrict-prototypes -Wmissing-prototypes +cflags=-Wpointer-arith -Wcast-qual -Wsign-compare + +dev { + # These cflags are added to the shared ones when + # you build the "dev" flavor. + cflags=-g +} + +#prod { +# You can specify additional CFLAGS here which are only +# included if you build with the "prod" flavor. +#} diff --git a/examples/integers/conf/build.conf b/examples/integers/conf/build.conf @@ -0,0 +1,18 @@ +# integers build config +# You can switch flavors using: kore flavor [newflavor] + +# The cflags below are shared between flavors +cflags=-Wall -Wmissing-declarations -Wshadow +cflags=-Wstrict-prototypes -Wmissing-prototypes +cflags=-Wpointer-arith -Wcast-qual -Wsign-compare + +dev { + # These cflags are added to the shared ones when + # you build the "dev" flavor. + cflags=-g +} + +#prod { +# You can specify additional CFLAGS here which are only +# included if you build with the "prod" flavor. +#} diff --git a/examples/json_yajl/conf/build.conf b/examples/json_yajl/conf/build.conf @@ -0,0 +1,19 @@ +# json_yajl build config +# You can switch flavors using: kore flavor [newflavor] + +# The cflags below are shared between flavors +cflags=-Wall -Wmissing-declarations -Wshadow +cflags=-Wstrict-prototypes -Wmissing-prototypes +cflags=-Wpointer-arith -Wcast-qual -Wsign-compare + +dev { + # These cflags are added to the shared ones when + # you build the "dev" flavor. + cflags=-g + ldflags=-lyajl +} + +#prod { +# You can specify additional CFLAGS here which are only +# included if you build with the "prod" flavor. +#} diff --git a/examples/ktunnel/conf/build.conf b/examples/ktunnel/conf/build.conf @@ -0,0 +1,18 @@ +# ktunnel build config +# You can switch flavors using: kore flavor [newflavor] + +# The cflags below are shared between flavors +cflags=-Wall -Wmissing-declarations -Wshadow +cflags=-Wstrict-prototypes -Wmissing-prototypes +cflags=-Wpointer-arith -Wcast-qual -Wsign-compare + +dev { + # These cflags are added to the shared ones when + # you build the "dev" flavor. + cflags=-g +} + +#prod { +# You can specify additional CFLAGS here which are only +# included if you build with the "prod" flavor. +#} diff --git a/examples/messaging/conf/build.conf b/examples/messaging/conf/build.conf @@ -0,0 +1,18 @@ +# messaging build config +# You can switch flavors using: kore flavor [newflavor] + +# The cflags below are shared between flavors +cflags=-Wall -Wmissing-declarations -Wshadow +cflags=-Wstrict-prototypes -Wmissing-prototypes +cflags=-Wpointer-arith -Wcast-qual -Wsign-compare + +dev { + # These cflags are added to the shared ones when + # you build the "dev" flavor. + cflags=-g +} + +#prod { +# You can specify additional CFLAGS here which are only +# included if you build with the "prod" flavor. +#} diff --git a/examples/nohttp/conf/build.conf b/examples/nohttp/conf/build.conf @@ -0,0 +1,18 @@ +# nohttp build config +# You can switch flavors using: kore flavor [newflavor] + +# The cflags below are shared between flavors +cflags=-Wall -Wmissing-declarations -Wshadow +cflags=-Wstrict-prototypes -Wmissing-prototypes +cflags=-Wpointer-arith -Wcast-qual -Wsign-compare + +dev { + # These cflags are added to the shared ones when + # you build the "dev" flavor. + cflags=-g +} + +#prod { +# You can specify additional CFLAGS here which are only +# included if you build with the "prod" flavor. +#} diff --git a/examples/parameters/conf/build.conf b/examples/parameters/conf/build.conf @@ -0,0 +1,18 @@ +# parameters build config +# You can switch flavors using: kore flavor [newflavor] + +# The cflags below are shared between flavors +cflags=-Wall -Wmissing-declarations -Wshadow +cflags=-Wstrict-prototypes -Wmissing-prototypes +cflags=-Wpointer-arith -Wcast-qual -Wsign-compare + +dev { + # These cflags are added to the shared ones when + # you build the "dev" flavor. + cflags=-g +} + +#prod { +# You can specify additional CFLAGS here which are only +# included if you build with the "prod" flavor. +#} diff --git a/examples/pgsql-sync/conf/build.conf b/examples/pgsql-sync/conf/build.conf @@ -0,0 +1,18 @@ +# pgsql-sync build config +# You can switch flavors using: kore flavor [newflavor] + +# The cflags below are shared between flavors +cflags=-Wall -Wmissing-declarations -Wshadow +cflags=-Wstrict-prototypes -Wmissing-prototypes +cflags=-Wpointer-arith -Wcast-qual -Wsign-compare + +dev { + # These cflags are added to the shared ones when + # you build the "dev" flavor. + cflags=-g +} + +#prod { +# You can specify additional CFLAGS here which are only +# included if you build with the "prod" flavor. +#} diff --git a/examples/pgsql/conf/build.conf b/examples/pgsql/conf/build.conf @@ -0,0 +1,18 @@ +# pgsql build config +# You can switch flavors using: kore flavor [newflavor] + +# The cflags below are shared between flavors +cflags=-Wall -Wmissing-declarations -Wshadow +cflags=-Wstrict-prototypes -Wmissing-prototypes +cflags=-Wpointer-arith -Wcast-qual -Wsign-compare + +dev { + # These cflags are added to the shared ones when + # you build the "dev" flavor. + cflags=-g +} + +#prod { +# You can specify additional CFLAGS here which are only +# included if you build with the "prod" flavor. +#} diff --git a/examples/pipe_task/conf/build.conf b/examples/pipe_task/conf/build.conf @@ -0,0 +1,18 @@ +# pipe_task build config +# You can switch flavors using: kore flavor [newflavor] + +# The cflags below are shared between flavors +cflags=-Wall -Wmissing-declarations -Wshadow +cflags=-Wstrict-prototypes -Wmissing-prototypes +cflags=-Wpointer-arith -Wcast-qual -Wsign-compare + +dev { + # These cflags are added to the shared ones when + # you build the "dev" flavor. + cflags=-g +} + +#prod { +# You can specify additional CFLAGS here which are only +# included if you build with the "prod" flavor. +#} diff --git a/examples/sse/conf/build.conf b/examples/sse/conf/build.conf @@ -0,0 +1,18 @@ +# sse build config +# You can switch flavors using: kore flavor [newflavor] + +# The cflags below are shared between flavors +cflags=-Wall -Wmissing-declarations -Wshadow +cflags=-Wstrict-prototypes -Wmissing-prototypes +cflags=-Wpointer-arith -Wcast-qual -Wsign-compare + +dev { + # These cflags are added to the shared ones when + # you build the "dev" flavor. + cflags=-g +} + +#prod { +# You can specify additional CFLAGS here which are only +# included if you build with the "prod" flavor. +#} diff --git a/examples/tasks/conf/build.conf b/examples/tasks/conf/build.conf @@ -0,0 +1,19 @@ +# tasks build config +# You can switch flavors using: kore flavor [newflavor] + +# The cflags below are shared between flavors +cflags=-Wall -Wmissing-declarations -Wshadow +cflags=-Wstrict-prototypes -Wmissing-prototypes +cflags=-Wpointer-arith -Wcast-qual -Wsign-compare + +dev { + # These cflags are added to the shared ones when + # you build the "dev" flavor. + cflags=-g + ldflags=-lcurl +} + +#prod { +# You can specify additional CFLAGS here which are only +# included if you build with the "prod" flavor. +#} diff --git a/examples/tls-proxy/conf/build.conf b/examples/tls-proxy/conf/build.conf @@ -0,0 +1,18 @@ +# tls-proxy build config +# You can switch flavors using: kore flavor [newflavor] + +# The cflags below are shared between flavors +cflags=-Wall -Wmissing-declarations -Wshadow +cflags=-Wstrict-prototypes -Wmissing-prototypes +cflags=-Wpointer-arith -Wcast-qual -Wsign-compare + +dev { + # These cflags are added to the shared ones when + # you build the "dev" flavor. + cflags=-g +} + +#prod { +# You can specify additional CFLAGS here which are only +# included if you build with the "prod" flavor. +#} diff --git a/examples/upload/conf/build.conf b/examples/upload/conf/build.conf @@ -0,0 +1,18 @@ +# upload build config +# You can switch flavors using: kore flavor [newflavor] + +# The cflags below are shared between flavors +cflags=-Wall -Wmissing-declarations -Wshadow +cflags=-Wstrict-prototypes -Wmissing-prototypes +cflags=-Wpointer-arith -Wcast-qual -Wsign-compare + +dev { + # These cflags are added to the shared ones when + # you build the "dev" flavor. + cflags=-g +} + +#prod { +# You can specify additional CFLAGS here which are only +# included if you build with the "prod" flavor. +#} diff --git a/examples/video_stream/conf/build.conf b/examples/video_stream/conf/build.conf @@ -0,0 +1,18 @@ +# video_stream build config +# You can switch flavors using: kore flavor [newflavor] + +# The cflags below are shared between flavors +cflags=-Wall -Wmissing-declarations -Wshadow +cflags=-Wstrict-prototypes -Wmissing-prototypes +cflags=-Wpointer-arith -Wcast-qual -Wsign-compare + +dev { + # These cflags are added to the shared ones when + # you build the "dev" flavor. + cflags=-g +} + +#prod { +# You can specify additional CFLAGS here which are only +# included if you build with the "prod" flavor. +#} diff --git a/examples/websocket/conf/build.conf b/examples/websocket/conf/build.conf @@ -0,0 +1,18 @@ +# websocket build config +# You can switch flavors using: kore flavor [newflavor] + +# The cflags below are shared between flavors +cflags=-Wall -Wmissing-declarations -Wshadow +cflags=-Wstrict-prototypes -Wmissing-prototypes +cflags=-Wpointer-arith -Wcast-qual -Wsign-compare + +dev { + # These cflags are added to the shared ones when + # you build the "dev" flavor. + cflags=-g +} + +#prod { +# You can specify additional CFLAGS here which are only +# included if you build with the "prod" flavor. +#}