Mercurial > projects > doodle
diff bob.cfg @ 139:e33f37b14893 default tip
Port to 'no-more-make' https://github.com/GrahamStJack/no-more-make
author | David Bryant <bagnose@gmail.com> |
---|---|
date | Sun, 30 Sep 2012 15:41:25 +0930 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bob.cfg Sun Sep 30 15:41:25 2012 +0930 @@ -0,0 +1,155 @@ +############################################################################### + +# Example bob configuration file. +# +# Used by 'bob-config' to establish a build directory, from which a 'bob' +# command will build your project. +# +# This file should be located at the top level of a repository, below which +# are source directories. +# +# Before running bob-config, you need to: +# * Check out the project's source repository(s). +# * Ensure that all the project's external dependencies are available, +# either in standard system locations or in local project-specific +# locations. +# Bob does not verify external dependencies. +# +# If your project is built for a number of target architectures, use +# one config file for each architecture, and specify which one on the bob-config +# command-line. +# +############################################################################### +# +# Top-level syntax is a series of sections, each starting with a line: +# [section-name] +# +# Comment lines begin with '#'. +# +# The syntax for each section is section-specific, and described in each +# section. +# +############################################################################### + + +[defines] + +# Define variables. +# +# Any relative paths provided in variable definitions are relative to +# the directory this file is in, which is also the working directory +# of bob-config. +# +# A variable definition is: name = text +# +# Variables used by bob are: +# +# PROJECT - Path to directory containing the project's top-level Bobfile. +# REPOS - Paths to other repos (if any), below which are source +# directories that are available to build as part of this project. +# SYS_INC - Non-standard paths searched for system includes. +# SYS_LIB - Non-standard paths searched for system libraries. +# SYS_PATH - Non-standard paths searched for system utilities. +# SYS_IMP - Non-standard paths searched for D imports. +# C_EXTERN - Top-level C/C++ packages that are external to the project. +# D_EXTERN - Top-level D packages that are external to the project. +# +# Also required are build commands. +# +# Build-command variables are used by bob to create the output files specified +# in the project's Bobfile(s). They are of the form: +# <input-ext> <output-ext>(s) = command +# Reserved extensions with special meaning are: +# .obj -> object file +# .slib -> static library +# .dlib -> dynamic library +# .exe -> executable +# The extensions actually used vary with platform. +# Libraries and executables are built from object files. +# +# The commands that use object files to create libraries and executables are +# specified with the extension of the source files, not .obj. +# .c source files may be mixed with other types of source files, +# but others may not. .h files are assumed to be header files. +# +# Reserved variables defined by bob from information in Bobfiles are: +# +# INPUT - Paths of the input file(s) relative to the build dir. +# OUTPUT - Paths of the resultant built file(s) relative to the build dir. +# PROJ_INC - Project include or import paths. +# PROJ_LIB - Project library paths. +# LIBS - Required libraries. +# +# ${} expands a variable, cross-multiplying it with whatever it is adjacent to. +# eg, if HEADERS = one two three, then -I${HEADERS} becomes -Ione -Itwo -Ithree. +# If the variable is empty, the cross-multiplication is also empty. +# If there is no adjacent text, the variable's value is used. +# Variable expansion occurs just before a build command is issued, after +# all dependencies are known. + +# Required +PROJECT = doodle +REPOS = +SYS_IMP = +SYS_INC = +SYS_LIB = +SYS_PATH = +C_EXTERN = +D_EXTERN = core std glib gdk gtk gtkc cairo + +# Compiler switches +CFLAGS = -fpic -pedantic -Werror -Wall -Wno-long-long -Wundef -Wredundant-decls -DFILE_PATH=${INPUT} +C++FLAGS = ${CFLAGS} -Woverloaded-virtual -Wsign-promo -Wctor-dtor-privacy -Wnon-virtual-dtor +DFLAGS = -w -wi -gc -Isrc/gtk +LINKFLAGS = +DLINKFLAGS = -L-L/home/dbryant/source/d/GtkD + +# Build commands + +# Contrived example of source-code generation. +.H .h = cp ${INPUT} ${OUTPUT} +.CPP .cpp = cp ${INPUT} ${OUTPUT} + +# Documentation +.rst .html = rst2html ${INPUT} ${OUTPUT} + +# Object files +.c .obj = gcc -c ${INPUT} -isystem${SYS_INC} -iquote${PROJ_INC} ${CFLAGS} -o ${OUTPUT} +.cpp .obj = g++ -c ${INPUT} -isystem${SYS_INC} -iquote${PROJ_INC} ${C++FLAGS} -o ${OUTPUT} +.d .obj = dmd -c ${INPUT} -I${SYS_IMP} -I${PROJ_INC} ${DFLAGS} -of${OUTPUT} + +# Static libraries +.c .slib = rm -f ${OUTPUT} && ar csr ${OUTPUT} ${INPUT} +.cpp .slib = rm -f ${OUTPUT} && ar csr ${OUTPUT} ${INPUT} +.d .slib = rm -f ${OUTPUT} && ar csr ${OUTPUT} ${INPUT} + +# Dynamic libraries +.c .dlib = gcc -shared ${INPUT} ${LINKFLAGS} -L${SYS_LIB} -L${PROJ_LIB} -l{LIBS} -o ${OUTPUT} +.cpp .dlib = g++ -shared ${INPUT} ${LINKFLAGS} -L${SYS_LIB} -L${PROJ_LIB} -l{LIBS} -o ${OUTPUT} + +# Executables +.c .exe = gcc ${INPUT} ${LINKFLAGS} -L${SYS_LIB} -L${PROJ_LIB} -l${LIBS} -o ${OUTPUT} +.cpp .exe = g++ ${INPUT} ${LINKFLAGS} -L${SYS_LIB} -L${PROJ_LIB} -l${LIBS} -o ${OUTPUT} +.d .exe = dmd ${INPUT} ${DLINKFLAGS} -L-L${SYS_LIB} -L-L${PROJ_LIB} -L-l${LIBS} -of${OUTPUT} + +[modes] + +# For each mode, add to already-defined variables. +# Format of a mode is: the name of the mode, followed by indented +# variable additions. eg: +# +# debug +# CFLAGS += ggdb3 +# +# Exactly one mode is in use for a given build directory, and is specified +# on the bob-config command line. eg: mode=debug + +debug + CFLAGS += -O1 -ggdb3 + C++FLAGS += -O1 -ggdb3 + DFLAGS += + +release + CFLAGS += -O2 -NDEBUG + C++FLAGS += -O2 -NDEBUG + DFLAGS += -O -release