1 default target 'default'
6 let prefix = '/usr/local'
11 '-D_POSIX_C_SOURCE=200809L'
15 '-DLOCALEDIR="./po/locale"'
27 '-Wdisabled-optimization'
29 '-Wduplicated-branches'
35 '-Wformat-truncation=2'
37 '-Wimplicit-fallthrough=2'
41 '-Wmissing-attributes'
43 '-Wmissing-declarations'
44 '-Wmissing-format-attribute'
45 '-Wmissing-include-dirs'
47 '-Wmissing-prototypes'
50 '-Wold-style-definition'
63 '-Wsuggest-attribute=cold'
64 '-Wsuggest-attribute=const'
65 '-Wsuggest-attribute=format'
66 '-Wsuggest-attribute=malloc'
67 '-Wsuggest-attribute=noreturn'
68 '-Wsuggest-attribute=pure'
69 '-Wsuggest-final-methods'
70 '-Wsuggest-final-types'
77 '-Wunused-const-variable=2'
81 '-Wvector-operation-performance'
82 '-Wvla-larger-than=4031'
94 '-Wbuiltin-declaration-mismatch'
95 '-Wbuiltin-macro-redefined'
99 '-Wcast-function-type'
105 '-Wcoverage-mismatch'
110 '-Wdeprecated-declarations'
112 '-Wdisabled-optimization'
113 '-Wdiscarded-array-qualifiers'
114 '-Wdiscarded-qualifiers'
117 '-Wduplicated-branches'
123 '-Wexpansion-to-defined'
129 '-Wformat-contains-nul'
130 '-Wformat-extra-args'
131 '-Wformat-nonliteral'
132 '-Wformat-overflow=2'
134 '-Wformat-signedness'
135 '-Wformat-truncation=2'
138 '-Wframe-larger-than=256'
139 '-Wfree-nonheap-object'
141 '-Wignored-attributes'
142 '-Wignored-qualifiers'
143 '-Wincompatible-pointer-types'
145 '-Wimplicit-fallthrough'
146 '-Wimplicit-fallthrough=2'
147 '-Wimplicit-function-declaration'
149 '-Winfinite-recursion'
153 '-Wint-in-bool-context'
154 '-Wint-to-pointer-cast'
155 '-Winvalid-memory-model'
159 '-Wlogical-not-parentheses'
162 '-Wlto-type-mismatch'
164 '-Wmaybe-uninitialized'
166 '-Wmemset-transposed-args'
167 '-Wmisleading-indentation'
168 '-Wmissing-attributes'
170 '-Wmissing-field-initializers'
171 '-Wmissing-format-attribute'
172 '-Wmissing-include-dirs'
176 '-Wmultistatement-macros'
181 '-Wopenacc-parallelism'
184 '-Woverlength-strings'
185 '-Woverride-init-side-effects'
187 '-Wpacked-bitfield-compat'
188 '-Wpacked-not-aligned'
192 '-Wpointer-to-int-cast'
197 '-Wreturn-local-addr'
199 '-Wscalar-storage-order'
204 '-Wshadow=compatible-local'
205 '-Wshift-count-negative'
206 '-Wshift-count-overflow'
207 '-Wshift-negative-value'
212 '-Wsizeof-array-argument'
214 '-Wsizeof-pointer-div'
215 '-Wsizeof-pointer-memaccess'
217 # '-Wstack-usage=256'
219 '-Wstrict-aliasing=3'
221 '-Wstrict-overflow=2'
223 '-Wstringop-overflow'
224 '-Wstringop-overread'
225 '-Wstringop-truncation'
230 '-Wswitch-outside-range'
231 '-Wswitch-unreachable'
234 '-Wtautological-compare'
237 '-Wtrivial-auto-var-init'
243 '-Wunsuffixed-float-constants'
245 '-Wunused-but-set-parameter'
246 '-Wunused-but-set-variable'
247 '-Wunused-const-variable'
248 '-Wunused-const-variable=2'
251 '-Wunused-local-typedefs'
259 '-Wvector-operation-performance'
261 '-Wvolatile-register-var'
263 '-Wzero-length-bounds'
268 '-fsanitize=alignment'
272 '-fsanitize=float-cast-overflow'
273 '-fsanitize=float-divide-by-zero'
274 '-fsanitize=integer-divide-by-zero'
275 '-fsanitize=nonnull-attribute'
277 '-fsanitize=object-size'
278 '-fsanitize=pointer-overflow'
280 '-fsanitize=returns-nonnull-attribute'
282 '-fsanitize=signed-integer-overflow'
285 '-fsanitize=undefined'
286 '-fsanitize=unreachable'
287 '-fsanitize=vla-bound'
292 '-D_FORTIFY_SOURCE=2'
304 let release_cflags = [
310 '-fno-fat-lto-objects'
311 '-fno-stack-protector'
312 '-fomit-frame-pointer'
327 '-fdiagnostics-color=always'
333 #PCC '-Wl,-znoexecstack'
337 description: 'YACC @in'
339 > -Wdangling-alias @in
343 description: 'LEX @in'
348 description: 'CC @in'
349 >@cc @cppflags @cflags -c -o @out @in
354 description: 'LINK @out'
355 >@cc @ldflags @cflags -o @out @in
359 let potfile = 'po/build.pot'
360 let pofiles = [ 'po/ru.po' ]
361 let mofiles = [ 'po/locale/ru/LC_MESSAGES/build.mo' ]
363 let xgettext_options = [
364 '--flag=N_:1:pass-c-format'
365 '--flag=S_:1:pass-c-format'
366 '--flag=S_:2:pass-c-format'
367 '--flag=_:1:pass-c-format'
368 '--flag=error:1:c-format'
369 '--flag=error_at:2:c-format'
370 '--flag=fatal:1:c-format'
371 '--flag=info:1:c-format'
372 '--flag=warning:1:c-format'
373 '--flag=warning_at:2:c-format'
378 '--keyword=YY_FATAL_ERROR:1'
386 description: 'MSGMERGE @out'
387 >msgmerge -U @out @in
391 description: 'XGETTEXT @out'
392 >xgettext @xgettext_options --package-name @package --package-version @version --default-domain @package --output @out @in
396 description: 'MSGFMT @in'
397 >msgfmt --check --statistics --verbose --output-file @out @in
400 file target [ 'src/parse.c' 'src/parse.h' ] @ 'src/parse.y' {
404 file target [ 'src/scan.c' 'src/scan.h' ] @ 'src/scan.l' {
408 #file target 'src/dep-scan.c' @ 'src/dep-scan.l' {
409 # lex @files -> @target
415 'src/cli-option-parser.c'
425 'src/libquote/quotearg.c'
426 'src/libquote/localcharset.c'
427 'src/libquote/system-quote.c'
428 'src/libquote/sh-quote.c'
431 file target 'src/build.o' : 'src/scan.c' 'src/parse.c' @ 'src/build.c' { compile @files -> @target }
432 file target 'src/diagnostic.o' @ 'src/diagnostic.c' { compile @files -> @target }
433 file target 'src/graph.o' @ 'src/graph.c' { compile @files -> @target }
434 file target 'src/hash.o' @ 'src/hash.c' { compile @files -> @target }
435 file target 'src/job-server.o' @ 'src/job-server.c' { compile @files -> @target }
436 file target 'src/parse.o' @ 'src/parse.c' { compile @files -> @target }
437 file target 'src/scan.o' @ 'src/scan.c' { compile @files -> @target }
438 file target 'src/thread.o' @ 'src/thread.c' { compile @files -> @target }
439 file target 'src/uniqstr.o' @ 'src/uniqstr.c' { compile @files -> @target }
440 file target 'src/yy.o' @ 'src/yy.c' { compile @files -> @target }
441 file target 'src/utils.o' @ 'src/utils.c' { compile @files -> @target }
442 file target 'src/cli-option-parser.o' @ 'src/cli-option-parser.c' { compile @files -> @target }
443 file target 'src/libquote/quotearg.o' @ 'src/libquote/quotearg.c' { compile @files -> @target }
444 file target 'src/libquote/localcharset.o' @ 'src/libquote/localcharset.c' { compile @files -> @target }
445 file target 'src/libquote/sh-quote.o' @ 'src/libquote/sh-quote.c' { compile @files -> @target }
446 file target 'src/libquote/system-quote.o' @ 'src/libquote/system-quote.c' { compile @files -> @target }
448 let objects = [ @sources.map('%.c' -> '%.o') ]
452 >./build -g | dot -Tpng -ograph.png
459 file target 'build' @ @objects {
460 link @files -> @target
463 target 'default': 'build' @mofiles
465 file target 'po/ru.po': @potfile {
466 msgmerge @dependencies -> @target
469 file target 'po/build.pot' @ @sources {
470 xgettext @files -> @target
473 file target 'po/locale/ru/LC_MESSAGES/build.mo' @ 'po/ru.po' {
474 msgfmt @files -> @target
483 rm @objects 'src/scan.h' 'src/scan.c' 'src/parse.h' 'src/parse.c'