comparison 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
comparison
equal deleted inserted replaced
138:a1c2b56cb44d 139:e33f37b14893
1 ###############################################################################
2
3 # Example bob configuration file.
4 #
5 # Used by 'bob-config' to establish a build directory, from which a 'bob'
6 # command will build your project.
7 #
8 # This file should be located at the top level of a repository, below which
9 # are source directories.
10 #
11 # Before running bob-config, you need to:
12 # * Check out the project's source repository(s).
13 # * Ensure that all the project's external dependencies are available,
14 # either in standard system locations or in local project-specific
15 # locations.
16 # Bob does not verify external dependencies.
17 #
18 # If your project is built for a number of target architectures, use
19 # one config file for each architecture, and specify which one on the bob-config
20 # command-line.
21 #
22 ###############################################################################
23 #
24 # Top-level syntax is a series of sections, each starting with a line:
25 # [section-name]
26 #
27 # Comment lines begin with '#'.
28 #
29 # The syntax for each section is section-specific, and described in each
30 # section.
31 #
32 ###############################################################################
33
34
35 [defines]
36
37 # Define variables.
38 #
39 # Any relative paths provided in variable definitions are relative to
40 # the directory this file is in, which is also the working directory
41 # of bob-config.
42 #
43 # A variable definition is: name = text
44 #
45 # Variables used by bob are:
46 #
47 # PROJECT - Path to directory containing the project's top-level Bobfile.
48 # REPOS - Paths to other repos (if any), below which are source
49 # directories that are available to build as part of this project.
50 # SYS_INC - Non-standard paths searched for system includes.
51 # SYS_LIB - Non-standard paths searched for system libraries.
52 # SYS_PATH - Non-standard paths searched for system utilities.
53 # SYS_IMP - Non-standard paths searched for D imports.
54 # C_EXTERN - Top-level C/C++ packages that are external to the project.
55 # D_EXTERN - Top-level D packages that are external to the project.
56 #
57 # Also required are build commands.
58 #
59 # Build-command variables are used by bob to create the output files specified
60 # in the project's Bobfile(s). They are of the form:
61 # <input-ext> <output-ext>(s) = command
62 # Reserved extensions with special meaning are:
63 # .obj -> object file
64 # .slib -> static library
65 # .dlib -> dynamic library
66 # .exe -> executable
67 # The extensions actually used vary with platform.
68 # Libraries and executables are built from object files.
69 #
70 # The commands that use object files to create libraries and executables are
71 # specified with the extension of the source files, not .obj.
72 # .c source files may be mixed with other types of source files,
73 # but others may not. .h files are assumed to be header files.
74 #
75 # Reserved variables defined by bob from information in Bobfiles are:
76 #
77 # INPUT - Paths of the input file(s) relative to the build dir.
78 # OUTPUT - Paths of the resultant built file(s) relative to the build dir.
79 # PROJ_INC - Project include or import paths.
80 # PROJ_LIB - Project library paths.
81 # LIBS - Required libraries.
82 #
83 # ${} expands a variable, cross-multiplying it with whatever it is adjacent to.
84 # eg, if HEADERS = one two three, then -I${HEADERS} becomes -Ione -Itwo -Ithree.
85 # If the variable is empty, the cross-multiplication is also empty.
86 # If there is no adjacent text, the variable's value is used.
87 # Variable expansion occurs just before a build command is issued, after
88 # all dependencies are known.
89
90 # Required
91 PROJECT = doodle
92 REPOS =
93 SYS_IMP =
94 SYS_INC =
95 SYS_LIB =
96 SYS_PATH =
97 C_EXTERN =
98 D_EXTERN = core std glib gdk gtk gtkc cairo
99
100 # Compiler switches
101 CFLAGS = -fpic -pedantic -Werror -Wall -Wno-long-long -Wundef -Wredundant-decls -DFILE_PATH=${INPUT}
102 C++FLAGS = ${CFLAGS} -Woverloaded-virtual -Wsign-promo -Wctor-dtor-privacy -Wnon-virtual-dtor
103 DFLAGS = -w -wi -gc -Isrc/gtk
104 LINKFLAGS =
105 DLINKFLAGS = -L-L/home/dbryant/source/d/GtkD
106
107 # Build commands
108
109 # Contrived example of source-code generation.
110 .H .h = cp ${INPUT} ${OUTPUT}
111 .CPP .cpp = cp ${INPUT} ${OUTPUT}
112
113 # Documentation
114 .rst .html = rst2html ${INPUT} ${OUTPUT}
115
116 # Object files
117 .c .obj = gcc -c ${INPUT} -isystem${SYS_INC} -iquote${PROJ_INC} ${CFLAGS} -o ${OUTPUT}
118 .cpp .obj = g++ -c ${INPUT} -isystem${SYS_INC} -iquote${PROJ_INC} ${C++FLAGS} -o ${OUTPUT}
119 .d .obj = dmd -c ${INPUT} -I${SYS_IMP} -I${PROJ_INC} ${DFLAGS} -of${OUTPUT}
120
121 # Static libraries
122 .c .slib = rm -f ${OUTPUT} && ar csr ${OUTPUT} ${INPUT}
123 .cpp .slib = rm -f ${OUTPUT} && ar csr ${OUTPUT} ${INPUT}
124 .d .slib = rm -f ${OUTPUT} && ar csr ${OUTPUT} ${INPUT}
125
126 # Dynamic libraries
127 .c .dlib = gcc -shared ${INPUT} ${LINKFLAGS} -L${SYS_LIB} -L${PROJ_LIB} -l{LIBS} -o ${OUTPUT}
128 .cpp .dlib = g++ -shared ${INPUT} ${LINKFLAGS} -L${SYS_LIB} -L${PROJ_LIB} -l{LIBS} -o ${OUTPUT}
129
130 # Executables
131 .c .exe = gcc ${INPUT} ${LINKFLAGS} -L${SYS_LIB} -L${PROJ_LIB} -l${LIBS} -o ${OUTPUT}
132 .cpp .exe = g++ ${INPUT} ${LINKFLAGS} -L${SYS_LIB} -L${PROJ_LIB} -l${LIBS} -o ${OUTPUT}
133 .d .exe = dmd ${INPUT} ${DLINKFLAGS} -L-L${SYS_LIB} -L-L${PROJ_LIB} -L-l${LIBS} -of${OUTPUT}
134
135 [modes]
136
137 # For each mode, add to already-defined variables.
138 # Format of a mode is: the name of the mode, followed by indented
139 # variable additions. eg:
140 #
141 # debug
142 # CFLAGS += ggdb3
143 #
144 # Exactly one mode is in use for a given build directory, and is specified
145 # on the bob-config command line. eg: mode=debug
146
147 debug
148 CFLAGS += -O1 -ggdb3
149 C++FLAGS += -O1 -ggdb3
150 DFLAGS +=
151
152 release
153 CFLAGS += -O2 -NDEBUG
154 C++FLAGS += -O2 -NDEBUG
155 DFLAGS += -O -release