mescc: Use records for Guile: preparation.
[mes.git] / make.scm
1 #! /bin/sh
2 # -*- scheme -*-
3 exec ${GUILE-guile} --no-auto-compile -L . -L guile -C . -C guile -s "$0" ${1+"$@"}
4 !#
5
6 (use-modules (srfi srfi-26)
7              (guix shell-utils))
8
9 ;; FIXME: .go dependencies
10 ;; workaround: always update .go before calculating hashes
11 ;;(use-modules ((mes make) #:select (sytem**)))
12 (define %scm-files
13   '("guix/make.scm"
14     "guix/records.scm"
15     "guix/shell-utils.scm"
16     "language/c99/compiler.scm"
17     "language/c99/info.scm"
18     "mes/as-i386.scm"
19     "mes/as.scm"
20     "mes/bytevectors.scm"
21     "mes/elf.scm"
22     "mes/M1.scm"))
23 (define %go-files (map (compose (cut string-append <> ".go") (cut string-drop-right <> 4)) %scm-files))
24 (setenv "srcdir" ".")
25 (setenv "host" %host-type)
26 (with-directory-excursion "guile"
27   (apply system* `("guile"
28                    "--no-auto-compile"
29                    "-L" "."
30                    "-C" "."
31                    "-s"
32                    "../build-aux/compile-all.scm"
33                    ,@%scm-files)))
34
35 (use-modules (srfi srfi-1)
36              (ice-9 curried-definitions)
37              (ice-9 match)
38              (guix make))
39
40 (add-target (bin.mescc "stage0/exit-42.c" #:libc #f))
41 (add-target (check "stage0/exit-42.0-guile" #:signal 11))  ; FIXME: segfault
42
43 (add-target (cpp.mescc "mlibc/mini-libc-mes.c"))
44 (add-target (compile.mescc "mlibc/mini-libc-mes.c"))
45
46 (add-target (bin.mescc "stage0/exit-42.c" #:libc mini-libc-mes.E))
47 (add-target (check "stage0/exit-42.mini-guile" #:exit 42))
48
49 (add-target (cpp.mescc "mlibc/libc-mes.c"))
50 (add-target (compile.mescc "mlibc/libc-mes.c"))
51
52 (add-target (bin.mescc "stage0/exit-42.c"))
53 (add-target (check "stage0/exit-42.guile" #:exit 42))
54
55 (define* (add-scaffold-test name #:key (exit 0) (libc libc-mes.E))
56   (add-target (bin.gcc (string-append "scaffold/tests/" name ".c") #:libc #f))
57   (add-target (check (string-append "scaffold/tests/" name ".mlibc-gcc") #:exit exit))
58
59   (add-target (bin.mescc (string-append "scaffold/tests/" name ".c") #:libc libc))
60   (add-target (check (string-append "scaffold/tests/" name "." (cond ((not libc) "0-")
61                                                                      ((eq? libc mini-libc-mes.E) "mini-")
62                                                                      (else "")) "guile") #:exit exit)))
63
64 ;; tests/00: exit, functions without libc
65 (add-scaffold-test "00-exit-0" #:libc #f)
66 (add-scaffold-test "01-return-0" #:libc #f)
67 (add-scaffold-test "02-return-1" #:libc #f #:exit 1)
68 (add-scaffold-test "03-call" #:libc #f)
69 (add-scaffold-test "04-call-0" #:libc #f)
70 (add-scaffold-test "05-call-1" #:libc #f #:exit 1)
71 (add-scaffold-test "06-call-!1" #:libc #f)
72
73 (add-target (group "check-scaffold-tests/0" #:dependencies (filter (target-prefix? "check-scaffold/tests/0") %targets)))
74
75 ;; tests/10: control without libc
76 (for-each
77  (cut add-scaffold-test <> #:libc #f)
78  '("10-if-0"
79    "11-if-1"
80    "12-if-=="
81    "13-if-!="
82    "14-if-goto"
83    "15-if-!f"
84    "16-if-t"))
85
86 (add-target (group "check-scaffold-tests/1" #:dependencies (filter (target-prefix? "check-scaffold/tests/1") %targets)))
87
88 ;; tests/20: loop without libc
89 (for-each
90  (cut add-scaffold-test <> #:libc #f)
91  '("20-while"
92    "21-char[]"
93    "22-while-char[]"))
94
95 (add-target (group "check-scaffold-tests/2" #:dependencies (filter (target-prefix? "check-scaffold/tests/2") %targets)))
96
97 ;; tests/30: call, compare: mini-libc-mes.c
98 (for-each
99  (cut add-scaffold-test <> #:libc mini-libc-mes.E)
100  '("30-strlen"
101    "31-eputs"
102    "32-compare"
103    "33-and-or"
104    "34-pre-post"
105    "35-compare-char"
106    "36-compare-arithmetic"
107    "37-compare-assign"
108    "38-compare-call"))
109
110 (add-target (group "check-scaffold-tests/3" #:dependencies (filter (target-prefix? "check-scaffold/tests/3") %targets)))
111
112 ;; tests/40: control: mini-libc-mes.c
113 (for-each
114  (cut add-scaffold-test <> #:libc mini-libc-mes.E)
115  '("40-if-else"
116    "41-?"
117    "42-goto-label"
118    "43-for-do-while"
119    "44-switch"
120    "45-void-call"))
121
122 (add-target (group "check-scaffold-tests/4" #:dependencies (filter (target-prefix? "check-scaffold/tests/4") %targets)))
123
124 ;; tests/50: libc-mes.c
125 (for-each
126  add-scaffold-test
127  '("50-assert"
128    "51-strcmp"
129    "52-itoa"
130    "54-argv"))
131
132 (add-target (group "check-scaffold-tests/5" #:dependencies (filter (target-prefix? "check-scaffold/tests/5") %targets)))
133
134 ;; tests/60: building up to scaffold/m.c, scaffold/micro-mes.c
135 (for-each
136  add-scaffold-test
137  '("60-math"
138    "61-array"
139    "63-struct-cell"
140    "64-make-cell"
141    "65-read"))
142
143 (add-target (group "check-scaffold-tests/6" #:dependencies (filter (target-prefix? "check-scaffold/tests/6") %targets)))
144
145 ;; tests/70: and beyond src/mes.c -- building up to 8cc.c, pcc.c, tcc.c, libguile/eval.c
146 (for-each
147  add-scaffold-test
148  '("70-printf"
149    "71-struct-array"))
150
151 (add-target (group "check-scaffold-tests/7" #:dependencies (filter (target-prefix? "check-scaffold/tests/7") %targets)))
152
153 (add-target (group "check-scaffold-tests" #:dependencies (filter (target-prefix? "check-scaffold/tests") %targets)))
154
155
156 (define* (add-tcc-test name)
157   (add-target (bin.gcc (string-append "scaffold/tinycc/" name ".c") #:libc #f #:includes '("scaffold/tinycc")))
158   (add-target (check (string-append "scaffold/tinycc/" name ".mlibc-gcc") #:baseline (string-append "scaffold/tinycc/" name ".expect")))
159
160   (add-target (bin.mescc (string-append "scaffold/tinycc/" name ".c") #:includes '("scaffold/tinycc")))
161   (add-target (check (string-append "scaffold/tinycc/" name ".guile") #:baseline (string-append "scaffold/tinycc/" name ".expect"))))
162 (map
163  add-tcc-test
164  '("00_assignment"
165    "01_comment"
166    "02_printf"
167    "03_struct"
168    "04_for"
169    "05_array"
170    "06_case"
171    "07_function"
172    "08_while"
173    "09_do_while"
174
175    "10_pointer"
176    "11_precedence"
177    "12_hashdefine"
178    "13_integer_literals"
179    "14_if"
180    "15_recursion"
181    "16_nesting"
182    "17_enum"
183    "18_include"
184    "19_pointer_arithmetic"
185
186    "20_pointer_comparison"
187    "21_char_array"
188    ;;"22_floating_point"       ; float
189    ;;"23_type_coercion"        ; float
190    ;;"24_math_library"         ; float
191    "25_quicksort"
192    ;;"27_sizeof"               ; float
193    ;;"28_strings"              ; TODO: strncpy strchr strrchr memset memcpy memcmp
194    "29_array_address"
195
196    ;;"30_hanoi"                ; fails with GCC
197    "31_args"
198    ;;"32_led"                  ; unsupported: (decl (decl-spec-list (stor-spec (static)) (type-spec (fixed-type "int"))) (init-declr-list (init-declr (array-of (ident "d") (p-expr (fixed "32"))))))
199    ;;"34_array_assignment"     ; fails with GCC
200    "33_ternary_op"
201    "35_sizeof"
202    ;;"36_array_initialisers"   ; unspported: (decl (decl-spec-list (type-spec (fixed-type "int"))) (init-declr-list (init-declr (array-of (ident "Array") (p-expr (fixed "10"))) (initzer (initzer-list (initzer (p-expr (fixed "12"))) (initzer (p-expr (fixed "34"))) (initzer (p-expr (fixed "56"))) (initzer (p-expr (fixed "78"))) (initzer (p-expr (fixed "90"))) (initzer (p-expr (fixed "123"))) (initzer (p-expr (fixed "456"))) (initzer (p-expr (fixed "789"))) (initzer (p-expr (fixed "8642"))) (initzer (p-expr (fixed "9753"))))))))
203    ;; "37_sprintf"             ; integer formatting unsupported
204    ;;"38_multiple_array_index" ; unspported: (decl (decl-spec-list (type-spec (fixed-type "int"))) (init-declr-list (init-declr (array-of (array-of (ident "a") (p-expr (fixed "4"))) (p-expr (fixed "4"))))))
205    ;;"39_typedef"              ; unsupported: (decl (decl-spec-list (stor-spec (typedef)) (type-spec (typename "MyFunStruct"))) (init-declr-list (init-declr (ptr-declr (pointer) (ident "MoreFunThanEver")))))
206
207    ;;"40_stdio"                ; f* functions
208    "41_hashif"
209    ;;"42_function_pointer"     ; f* functions
210    "43_void_param"
211    "44_scoped_declarations"
212    ;; "45_empty_for"           ; unsupported
213    ;;"46_grep"                 ; f* functions
214    "47_switch_return"
215    "48_nested_break"
216    ;;"49_bracket_evaluation"   ; float
217
218    "50_logical_second_arg"
219    ;;"51_static"               ; unsupported: (decl (decl-spec-list (stor-spec (static)) (type-spec (fixed-type "int"))) (init-declr-list (init-declr (ident "fred") (initzer (p-expr (fixed "1234"))))))
220    ;;"52_unnamed_enum"         ; unsupported: (decl (decl-spec-list (stor-spec (typedef)) (type-spec (enum-def (enum-def-list (enum-defn (ident "e")) (enum-defn (ident "f")) (enum-defn (ident "g")))))) (init-declr-list (init-declr (ident "h"))))
221    "54_goto"
222    ;;"55_lshift_type"          ; unsigned
223    ))
224
225 (add-target (group "check-scaffold-tinycc" #:dependencies (filter (target-prefix? "check-scaffold/tinycc") %targets)))
226
227 ;;(add-target (group "check-scaffold" #:dependencies (filter (target-prefix? "check-scaffold") %targets)))
228
229 (add-target (bin.gcc "scaffold/hello.c"))
230 (add-target (check "scaffold/hello.gcc" #:exit 42))
231
232 (add-target (bin.gcc "scaffold/hello.c" #:libc #f))
233 (add-target (check "scaffold/hello.mlibc-gcc" #:exit 42))
234
235 (add-target (bin.mescc "scaffold/hello.c" #:libc mini-libc-mes.E))
236 (add-target (check "scaffold/hello.mini-guile" #:exit 42))
237
238 (add-target (bin.mescc "scaffold/hello.c"))
239 (add-target (check "scaffold/hello.guile" #:exit 42))
240
241
242 (add-target (bin.gcc "scaffold/m.c"))
243 (add-target (check "scaffold/m.gcc" #:exit 255))
244
245 (add-target (bin.gcc "scaffold/m.c" #:libc #f))
246 (add-target (check "scaffold/m.mlibc-gcc" #:exit 255))
247
248 (add-target (bin.mescc "scaffold/m.c"))
249 (add-target (check "scaffold/m.guile" #:exit 255))
250
251 (add-target (bin.gcc "scaffold/micro-mes.c" #:libc #f))
252 (add-target (check "scaffold/micro-mes.mlibc-gcc" #:exit 6)) ; arg1 arg2 arg3 arg4 arg5
253
254 (add-target (bin.mescc "scaffold/micro-mes.c"))
255 (add-target (check "scaffold/micro-mes.guile" #:exit 6)) ; arg1 arg2 arg3 arg4 arg5
256
257 (add-target (group "check-scaffold" #:dependencies (filter (target-prefix? "check-scaffold") %targets)))
258
259 (define snarf-bases
260   '("gc" "lib" "math" "mes" "posix" "reader" "vector"))
261
262 (define bla
263   `(,@(map (cut string-append "src/" <> ".c") snarf-bases)
264     ,@(map (cut string-append "src/" <> ".mes.h") snarf-bases)
265     ,@(map (cut string-append "src/" <> ".mes.i") snarf-bases)
266     ,@(map (cut string-append "src/" <> ".mes.environment.i") snarf-bases)))
267
268 (define gcc-snarf-targets
269   (list
270    (add-target (snarf "src/gc.c" #:mes? #f))
271    (add-target (snarf "src/lib.c" #:mes? #f))
272    (add-target (snarf "src/math.c" #:mes? #f))
273    (add-target (snarf "src/mes.c" #:mes? #f))
274    (add-target (snarf "src/posix.c" #:mes? #f))
275    (add-target (snarf "src/reader.c" #:mes? #f))
276    (add-target (snarf "src/vector.c" #:mes? #f))))
277
278 (define mes-snarf-targets
279   (list
280    (add-target (snarf "src/gc.c"))
281    (add-target (snarf "src/lib.c" #:mes? #t))
282    (add-target (snarf "src/math.c" #:mes? #t))
283    (add-target (snarf "src/mes.c" #:mes? #t))
284    (add-target (snarf "src/posix.c" #:mes? #t))
285    (add-target (snarf "src/reader.c" #:mes? #t))
286    (add-target (snarf "src/vector.c" #:mes? #t))))
287
288 (add-target (bin.gcc "src/mes.c" #:dependencies gcc-snarf-targets
289                      #:defines `("FIXED_PRIMITIVES=1"
290                                  "MES_FULL=1"
291                                  "POSIX=1"
292                                  ,(string-append "VERSION=\"" %version "\"")
293                                  ,(string-append "MODULEDIR=\"" (string-append %moduledir "/") "\"")
294                                  ,(string-append "PREFIX=\"" %prefix "\""))))
295
296 (add-target (bin.gcc "src/mes.c" #:libc #f
297                      #:dependencies mes-snarf-targets
298                      #:defines `("FIXED_PRIMITIVES=1"
299                                  "MES_FULL=1"
300                                  ,(string-append "VERSION=\"" %version "\"")
301                                  ,(string-append "MODULEDIR=\"" (string-append %moduledir "/") "\"")
302                                  ,(string-append "PREFIX=\"" %prefix "\""))))
303
304 (add-target (bin.mescc "src/mes.c" #:dependencies mes-snarf-targets
305                        #:defines `("FIXED_PRIMITIVES=1"
306                                    "MES_FULL=1"
307                                  ,(string-append "VERSION=\"" %version "\"")
308                                  ,(string-append "MODULEDIR=\"" (string-append %moduledir "/") "\"")
309                                  ,(string-append "PREFIX=\"" %prefix "\""))))
310
311 (define mes-tests
312   '("tests/read.test"
313     "tests/base.test"
314     "tests/closure.test"
315     "tests/quasiquote.test"
316     "tests/let.test"
317     "tests/scm.test"
318     "tests/display.test"
319     "tests/cwv.test"
320     "tests/math.test"
321     "tests/vector.test"
322     "tests/srfi-1.test"
323     "tests/srfi-13.test"
324     "tests/srfi-14.test"
325     "tests/optargs.test"
326     "tests/fluids.test"
327     "tests/catch.test"
328     "tests/psyntax.test"
329     "tests/pmatch.test"
330     "tests/let-syntax.test"
331     "tests/guile.test"
332     "tests/record.test"
333     ;;sloooowwww
334     ;;"tests/match.test"
335     ;;"tests/peg.test"
336     ))
337
338 (define (add-mes.gcc-test o)
339   (add-target (target (file-name o)))
340   (add-target (check o #:dependencies (list (get-target "src/mes.mlibc-gcc")))))
341
342 (define (add-mes.guile-test o)
343   (add-target (target (file-name o)))
344   (add-target (check o #:dependencies (list (get-target "src/mes.guile")))))
345
346 ;; takes long, and should always pass if...
347 ;;(for-each add-mes.gcc-test mes-tests)
348
349 ;; ...mes.guile passes :-)
350 (for-each add-mes.guile-test mes-tests)
351
352 ;; FIXME: run tests/base.test
353 (setenv "MES" "src/mes.guile")
354
355 (add-target (install "guile/mescc.scm" #:dir "bin" #:substitutes #t))
356 (add-target (install "scripts/mescc.mes" #:dir "bin" #:substitutes #t))
357 (add-target (install "scripts/repl.mes" #:dir "bin" #:substitutes #t))
358 (define bootstrap? #f)
359 (if bootstrap?
360     (add-target (install "src/mes.mes" #:dir "bin" #:installed-name "mes"))
361     (add-target (install "src/mes.guile" #:dir "bin" #:installed-name "mes")))
362
363 (define* ((install-dir #:key dir) name)
364   (add-target (install name  #:dir (string-append dir "/" (dirname name)))))
365
366 (add-target (install "module/mes/base-0.mes" #:dir (string-append %moduledir "/mes") #:substitutes #t))
367 (add-target (install "module/language/c99/compiler.mes" #:dir (string-append %moduledir "/language/c99") #:substitutes #t))
368
369 (define %module-dir "share/mes")
370 (for-each
371  (lambda (f)
372    ((install-dir #:dir (string-append %module-dir)) f))
373  '("module/language/c99/compiler.mes"
374    "module/language/c99/compiler.scm"
375    "module/language/c99/info.mes"
376    "module/language/c99/info.scm"
377    "module/language/paren.mes"
378    "module/mes/M1.mes"
379    "module/mes/M1.scm"
380    "module/mes/as-i386.mes"
381    "module/mes/as-i386.scm"
382    "module/mes/as.mes"
383    "module/mes/as.scm"
384    ;;"module/mes/base-0.mes"
385    "module/mes/base.mes"
386    "module/mes/bytevectors.mes"
387    "module/mes/bytevectors.scm"
388    "module/mes/catch.mes"
389    "module/mes/display.mes"
390    "module/mes/elf.mes"
391    "module/mes/elf.scm"
392    "module/mes/fluids.mes"
393    "module/mes/getopt-long.mes"
394    "module/mes/getopt-long.scm"
395    "module/mes/guile.mes"
396    "module/mes/lalr.mes"
397    "module/mes/lalr.scm"
398    "module/mes/let.mes"
399    "module/mes/match.mes"
400    "module/mes/match.scm"
401    "module/mes/optargs.mes"
402    "module/mes/optargs.scm"
403    "module/mes/peg.mes"
404    "module/mes/peg/cache.scm"
405    "module/mes/peg/codegen.scm"
406    "module/mes/peg/simplify-tree.scm"
407    "module/mes/peg/string-peg.scm"
408    "module/mes/peg/using-parsers.scm"
409    "module/mes/pmatch.mes"
410    "module/mes/pmatch.scm"
411    "module/mes/posix.mes"
412    "module/mes/pretty-print.mes"
413    "module/mes/pretty-print.scm"
414    "module/mes/psyntax-0.mes"
415    "module/mes/psyntax-1.mes"
416    "module/mes/psyntax.mes"
417    "module/mes/psyntax.pp"
418    "module/mes/psyntax.ss"
419    "module/mes/quasiquote.mes"
420    "module/mes/quasisyntax.mes"
421    "module/mes/quasisyntax.scm"
422    "module/mes/read-0.mes"
423    "module/mes/record-0.mes"
424    "module/mes/record.mes"
425    "module/mes/repl.mes"
426    "module/mes/scm.mes"
427    "module/mes/syntax.mes"
428    "module/mes/syntax.scm"
429    "module/mes/test.mes"
430    "module/mes/tiny-0.mes"
431    "module/mes/type-0.mes"
432    "module/nyacc/lalr.mes"
433    "module/nyacc/lang/c99/cpp.mes"
434    "module/nyacc/lang/c99/parser.mes"
435    "module/nyacc/lang/calc/parser.mes"
436    "module/nyacc/lang/util.mes"
437    "module/nyacc/lex.mes"
438    "module/nyacc/parse.mes"
439    "module/nyacc/util.mes"
440    "module/rnrs/arithmetic/bitwise.mes"
441    "module/srfi/srfi-0.mes"
442    "module/srfi/srfi-1.mes"
443    "module/srfi/srfi-1.scm"
444    "module/srfi/srfi-13.mes"
445    "module/srfi/srfi-14.mes"
446    "module/srfi/srfi-16.mes"
447    "module/srfi/srfi-16.scm"
448    "module/srfi/srfi-26.mes"
449    "module/srfi/srfi-26.scm"
450    "module/srfi/srfi-43.mes"
451    "module/srfi/srfi-9-psyntax.mes"
452    "module/srfi/srfi-9.mes"
453    "module/srfi/srfi-9.scm"
454    "module/sxml/xpath.mes"
455    "module/sxml/xpath.scm"))
456
457 (define* ((install-guile-dir #:key dir) name)
458   (add-target (install (string-append "guile/" name) #:dir (string-append dir "/" (dirname name)))))
459
460 (for-each
461  (lambda (f)
462    ((install-guile-dir #:dir (string-append %guiledir)) f))
463  %scm-files)
464
465 (for-each
466  (lambda (f)
467    ((install-guile-dir #:dir (string-append %godir)) f))
468  %go-files)
469
470 (add-target (install "mlibc/libc-mes.E" #:dir "lib"))
471 (add-target (install "mlibc/libc-mes.M1" #:dir "lib"))
472 (add-target (install "mlibc/mini-libc-mes.E" #:dir "lib"))
473 (add-target (install "mlibc/mini-libc-mes.M1" #:dir "lib"))
474
475 (for-each
476  (lambda (f)
477    ((install-dir #:dir "share/") f))
478  '("mlibc/include/alloca.h"
479    "mlibc/include/assert.h"
480    "mlibc/include/ctype.h"
481    "mlibc/include/dlfcn.h"
482    "mlibc/include/errno.h"
483    "mlibc/include/fcntl.h"
484    "mlibc/include/features.h"
485    "mlibc/include/inttypes.h"
486    "mlibc/include/libgen.h"
487    "mlibc/include/limits.h"
488    "mlibc/include/locale.h"
489    "mlibc/include/math.h"
490    "mlibc/include/mlibc.h"
491    "mlibc/include/setjmp.h"
492    "mlibc/include/signal.h"
493    "mlibc/include/stdarg.h"
494    "mlibc/include/stdbool.h"
495    "mlibc/include/stdint.h"
496    "mlibc/include/stdio.h"
497    "mlibc/include/stdlib.h"
498    "mlibc/include/stdnoreturn.h"
499    "mlibc/include/string.h"
500    "mlibc/include/strings.h"
501    "mlibc/include/sys/cdefs.h"
502    "mlibc/include/sys/mman.h"
503    "mlibc/include/sys/stat.h"
504    "mlibc/include/sys/time.h"
505    "mlibc/include/sys/timeb.h"
506    "mlibc/include/sys/types.h"
507    "mlibc/include/sys/ucontext.h"
508    "mlibc/include/sys/wait.h"
509    "mlibc/include/time.h"
510    "mlibc/include/unistd.h"))
511
512 (for-each
513  (compose add-target (cut install <> #:dir "share/doc/mes"))
514  '("AUTHORS"
515    ;;"ChangeLog"
516    "COPYING"
517    "HACKING"
518    "INSTALL"
519    "NEWS"
520    "README"))
521
522 (add-target (install "doc/fosdem/fosdem.pdf" #:dir "share/doc/mes"))
523
524 (define (main args)
525   (cond ((member "all-go" args) #t)
526         ((member "clean-go" args) (map delete-file (filter file-exists? %go-files)))
527         ((member "clean" args) (clean))
528         ((member "list" args) (display (string-join (map target-file-name %targets) "\n" 'suffix)))
529         ((member "help" args) (format #t "Usage: ./make.scm [TARGET]...
530
531 Targets:
532     all
533     all-go
534     check
535     clean
536     clean-go
537     help~a
538     install
539     list
540 "
541                                       (string-join (filter (negate (cut string-index <> #\/)) (map target-file-name %targets)) "\n    " 'prefix)))
542         (else
543          (let ((targets (match args
544                           (() (filter (negate check-target?) %targets))
545                           ((? (cut member "all" <>)) (filter (conjoin (negate install-target?)
546                                                                       (negate check-target?))
547                                                              %targets))
548                           ((? (cut member "check" <>)) (filter check-target? %targets))
549                           ((? (cut member "install" <>)) (filter install-target? %targets))
550                           (_ (filter-map (cut get-target <>) args)))))
551            (for-each build targets)
552            ;;((@@ (mes make) store) #:print 0)
553            (exit %status)))))
554
555 (main (cdr (command-line)))