3 exec ${GUILE-guile} --no-auto-compile -L . -L guile -C . -C guile -s "$0" ${1+"$@"}
6 (use-modules (srfi srfi-26)
9 ;; FIXME: .go dependencies
10 ;; workaround: always update .go before calculating hashes
11 ;;(use-modules ((mes make) #:select (sytem**)))
15 "guix/shell-utils.scm"
16 "language/c99/compiler.scm"
17 "language/c99/info.scm"
24 (define %go-files (map (compose (cut string-append <> ".go") (cut string-drop-right <> 4)) %scm-files))
26 (setenv "host" %host-type)
27 (with-directory-excursion "guile"
28 (apply system* `("guile"
33 "../build-aux/compile-all.scm"
36 (use-modules (srfi srfi-1)
37 (ice-9 curried-definitions)
41 (define crt1.hex2 (m1.as "mlibc/crt1.c"))
42 (add-target crt1.hex2)
44 (add-target crt1.mlibc-o)
49 "--BaseAddress=0x1000000"))
50 (define %HEX2 (PATH-search-path "hex2"))
52 (define* (LINK.hex2 #:key (hex2 %HEX2) (hex2-flags %HEX2-FLAGS) (crt1 crt1.hex2) (libc libc-mes.hex2) debug?)
53 (method (name "LINK.hex2")
55 (let* ((input-files (map target-file-name (target-inputs t)))
56 ;; FIXME: snarf inputs
57 (input-files (filter (lambda (f) (and (string-suffix? "hex2" f)
58 (not (member f (cdr input-files)))))
60 (format #t " ~a\t ~a -> ~a\n" (method-name o) (string-join input-files) (target-file-name t))
61 (with-output-to-file (target-file-name t)
63 (set-port-encoding! (current-output-port) "ISO-8859-1")
65 (apply assert-gulp-pipe*
69 ,(if (not debug?) "stage0/elf32-0header.hex2"
70 "stage0/elf32-header.hex2")
71 ,@(if crt1 `("-f" ,(target-file-name crt1)) '())
72 ,@(if libc `("-f" ,(target-file-name libc)) '())
73 ,@(append-map (cut list "-f" <>) input-files)
75 ,(if (not debug?) "stage0/elf-0footer.hex2"
76 "stage0/elf32-footer-single-main.hex2"))))))
77 (chmod (target-file-name t) #o755))))
78 (inputs `(,(store #:add-file "stage0/elf32-0header.hex2")
79 ,@(if crt1 (target-inputs crt1) '())
80 ,@(if libc (target-inputs libc) '())
81 ,(store #:add-file "stage0/elf-0footer.hex2")))))
83 (define* (bin.mescc input-file-name #:key (cc %MESCC) (hex2 %HEX2) (m1 %M1) (crt1 crt1.hex2) (libc libc-mes.hex2) (dependencies '()) (defines '()) (includes '()))
84 (let* ((base-name (base-name input-file-name ".c"))
85 ;;(foo (format (current-error-port) "bin[~s .c] base=~s\n" input-file-name base-name))
86 (suffix (cond ((not libc) ".0-guile")
87 ((eq? libc libc-mes.hex2) ".guile")
88 ((eq? libc libc-mes+tcc.hex2) ".tcc-guile")
89 (else ".mini-guile")))
90 (target-file-name (string-append base-name suffix))
91 (hex2-target (m1.as input-file-name #:m1 m1 #:cc cc #:defines defines #:includes includes #:dependencies dependencies)))
92 (target (file-name target-file-name)
93 (inputs `(,hex2-target
94 ,@(if crt1 (list crt1) '())
95 ,@(if libc (list libc) '())))
96 (method (LINK.hex2 #:hex2 hex2 #:crt1 crt1 #:libc libc #:debug? (eq? libc libc-mes.hex2))))))
98 ;;(define mini-libc-mes.E (m1.as "mlibc/mini-libc-mes.c"))
100 (define libc-mes.hex2 (m1.as "mlibc/libc-mes.c"))
101 (add-target libc-mes.hex2)
103 (define mini-libc-mes.hex2 (m1.as "mlibc/mini-libc-mes.c"))
104 (add-target mini-libc-mes.hex2)
106 (define libc-mes+tcc.hex2 (m1.as "mlibc/libc-mes+tcc.c"))
107 (add-target libc-mes+tcc.hex2)
109 (add-target (bin.mescc "stage0/exit-42.c" #:libc #f))
110 (add-target (check "stage0/exit-42.0-guile" #:exit 42))
112 (add-target (cpp.mescc "mlibc/mini-libc-mes.c"))
113 (add-target (compile.mescc "mlibc/mini-libc-mes.c"))
115 (add-target (bin.mescc "stage0/exit-42.c" #:libc mini-libc-mes.hex2))
116 (add-target (check "stage0/exit-42.mini-guile" #:exit 42))
118 (add-target (cpp.mescc "mlibc/libc-mes.c"))
119 (add-target (compile.mescc "mlibc/libc-mes.c"))
121 (add-target (bin.mescc "stage0/exit-42.c"))
122 (add-target (check "stage0/exit-42.guile" #:exit 42))
124 (define* (add-scaffold-test name #:key (exit 0) (libc libc-mes.hex2) (libc-gcc libc-gcc.mlibc-o))
125 (add-target (bin.gcc (string-append "scaffold/tests/" name ".c") #:libc libc-gcc))
126 (add-target (check (string-append "scaffold/tests/" name ".mlibc-gcc") #:exit exit))
128 (add-target (bin.mescc (string-append "scaffold/tests/" name ".c") #:libc libc))
129 (add-target (check (string-append "scaffold/tests/" name "." (cond ((not libc) "0-")
130 ((eq? libc mini-libc-mes.hex2) "mini-")
131 (else "")) "guile") #:exit exit)))
133 (add-target (compile.gcc "mlibc/crt1.c" #:libc #f))
134 (add-target (compile.gcc "mlibc/libc-gcc.c" #:libc #f))
135 (add-target (compile.gcc "mlibc/libc-gcc+tcc.c" #:libc #f))
137 ;;(add-scaffold-test "t" #:libc mini-libc-mes.hex2)
138 (add-scaffold-test "t")
139 ;;(add-scaffold-test "t" #:libc libc-mes+tcc.hex2)
141 ;; tests/00: exit, functions without libc
142 (add-scaffold-test "00-exit-0" #:libc #f)
143 (add-scaffold-test "01-return-0" #:libc #f)
144 (add-scaffold-test "02-return-1" #:libc #f #:exit 1)
145 (add-scaffold-test "03-call" #:libc #f)
146 (add-scaffold-test "04-call-0" #:libc #f)
147 (add-scaffold-test "05-call-1" #:libc #f #:exit 1)
148 (add-scaffold-test "06-call-!1" #:libc #f)
150 (add-target (group "check-scaffold-tests/0" #:dependencies (filter (target-prefix? "check-scaffold/tests/0") %targets)))
152 ;; tests/10: control without libc
154 (cut add-scaffold-test <> #:libc #f)
163 (add-target (group "check-scaffold-tests/1" #:dependencies (filter (target-prefix? "check-scaffold/tests/1") %targets)))
165 ;; tests/20: loop without libc
167 (cut add-scaffold-test <> #:libc #f)
173 (add-target (group "check-scaffold-tests/2" #:dependencies (filter (target-prefix? "check-scaffold/tests/2") %targets)))
175 ;; tests/30: call, compare: mini-libc-mes.c
177 (cut add-scaffold-test <> #:libc mini-libc-mes.hex2)
184 "36-compare-arithmetic"
188 (add-target (group "check-scaffold-tests/3" #:dependencies (filter (target-prefix? "check-scaffold/tests/3") %targets)))
190 ;; tests/40: control: mini-libc-mes.c
192 (cut add-scaffold-test <> #:libc mini-libc-mes.hex2)
200 (add-target (group "check-scaffold-tests/4" #:dependencies (filter (target-prefix? "check-scaffold/tests/4") %targets)))
202 ;; tests/50: libc-mes.c
210 (add-target (group "check-scaffold-tests/5" #:dependencies (filter (target-prefix? "check-scaffold/tests/5") %targets)))
212 ;; tests/60: building up to scaffold/m.c, scaffold/micro-mes.c
221 (add-target (group "check-scaffold-tests/6" #:dependencies (filter (target-prefix? "check-scaffold/tests/6") %targets)))
223 ;; tests/70: and beyond src/mes.c -- building up to 8cc.c, pcc.c, tcc.c, libguile/eval.c
228 "72-typedef-struct-def"
230 "74-multi-line-string"
232 "76-pointer-arithmetic"
236 "7a-struct-char-array"
237 "7b-struct-int-array"
240 "7e-struct-array-access"
241 "7f-struct-pointer-arithmetic"
242 "7g-struct-byte-word-field"
247 "7l-struct-any-size-array"
248 "7m-struct-char-array-assign"
249 "7n-struct-struct-array"))
251 (add-target (group "check-scaffold-tests/7" #:dependencies (filter (target-prefix? "check-scaffold/tests/7") %targets)))
253 (add-target (group "check-scaffold-tests" #:dependencies (filter (target-prefix? "check-scaffold/tests") %targets)))
255 (add-target (cpp.mescc "mlibc/libc-mes+tcc.c"))
256 (add-target (compile.mescc "mlibc/libc-mes+tcc.c"))
258 (define* (add-tcc-test name)
259 (add-target (bin.gcc (string-append "scaffold/tinycc/" name ".c") #:libc libc-gcc.mlibc-o #:includes '("scaffold/tinycc")))
260 (add-target (check (string-append "scaffold/tinycc/" name ".mlibc-gcc") #:baseline (string-append "scaffold/tinycc/" name ".expect")))
262 (add-target (bin.mescc (string-append "scaffold/tinycc/" name ".c") #:includes '("scaffold/tinycc")))
263 (add-target (check (string-append "scaffold/tinycc/" name ".guile") #:baseline (string-append "scaffold/tinycc/" name ".expect"))))
280 "13_integer_literals"
286 "19_pointer_arithmetic"
288 "20_pointer_comparison"
290 ;;"22_floating_point" ; float
291 ;;"23_type_coercion" ; float
292 ;;"24_math_library" ; float
294 ;;"27_sizeof" ; float
295 ;;"28_strings" ; TODO: strncpy strchr strrchr memset memcpy memcmp
298 ;;"30_hanoi" ; fails with GCC
300 ;;"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"))))))
301 ;;"34_array_assignment" ; fails with GCC
304 ;;"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"))))))))
305 ;; "37_sprintf" ; integer formatting unsupported
306 ;;"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"))))))
307 ;;"39_typedef" ; unsupported: (decl (decl-spec-list (stor-spec (typedef)) (type-spec (typename "MyFunStruct"))) (init-declr-list (init-declr (ptr-declr (pointer) (ident "MoreFunThanEver")))))
309 ;;"40_stdio" ; f* functions
311 ;;"42_function_pointer" ; f* functions
313 "44_scoped_declarations"
314 "45_empty_for" ; unsupported
315 ;;"46_grep" ; f* functions
318 ;;"49_bracket_evaluation" ; float
320 "50_logical_second_arg"
321 ;;"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"))))))
322 ;;"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"))))
324 ;;"55_lshift_type" ; unsigned
327 (add-target (group "check-scaffold-tinycc" #:dependencies (filter (target-prefix? "check-scaffold/tinycc") %targets)))
329 ;;(add-target (group "check-scaffold" #:dependencies (filter (target-prefix? "check-scaffold") %targets)))
331 (add-target (bin.gcc "scaffold/main.c"))
332 (add-target (check "scaffold/main.gcc" #:exit 42))
334 (add-target (bin.gcc "scaffold/main.c" #:libc #f))
335 (add-target (check "scaffold/main.mlibc-gcc" #:exit 42))
337 (add-target (bin.mescc "scaffold/main.c" #:libc mini-libc-mes.hex2))
338 (add-target (check "scaffold/main.mini-guile" #:exit 42))
340 (add-target (bin.mescc "scaffold/main.c"))
341 (add-target (check "scaffold/main.guile" #:exit 42))
344 (add-target (bin.gcc "scaffold/hello.c"))
345 (add-target (check "scaffold/hello.gcc" #:exit 42))
347 (add-target (bin.gcc "scaffold/hello.c" #:libc libc-gcc.mlibc-o))
348 (add-target (check "scaffold/hello.mlibc-gcc" #:exit 42))
350 (add-target (bin.mescc "scaffold/hello.c" #:libc mini-libc-mes.hex2))
351 (add-target (check "scaffold/hello.mini-guile" #:exit 42))
353 (add-target (bin.mescc "scaffold/hello.c"))
354 (add-target (check "scaffold/hello.guile" #:exit 42))
357 (add-target (bin.gcc "scaffold/m.c"))
358 (add-target (check "scaffold/m.gcc" #:exit 255))
360 (add-target (bin.gcc "scaffold/m.c" #:libc libc-gcc.mlibc-o))
361 (add-target (check "scaffold/m.mlibc-gcc" #:exit 255))
363 (add-target (bin.mescc "scaffold/m.c"))
364 (add-target (check "scaffold/m.guile" #:exit 255))
366 (add-target (bin.gcc "scaffold/micro-mes.c" #:libc libc-gcc.mlibc-o))
367 (add-target (check "scaffold/micro-mes.mlibc-gcc" #:exit 6)) ; arg1 arg2 arg3 arg4 arg5
369 (add-target (bin.mescc "scaffold/micro-mes.c"))
370 (add-target (check "scaffold/micro-mes.guile" #:exit 6)) ; arg1 arg2 arg3 arg4 arg5
372 (add-target (group "check-scaffold" #:dependencies (filter (target-prefix? "check-scaffold") %targets)))
375 '("gc" "lib" "math" "mes" "posix" "reader" "vector"))
378 `(,@(map (cut string-append "src/" <> ".c") snarf-bases)
379 ,@(map (cut string-append "src/" <> ".mes.h") snarf-bases)
380 ,@(map (cut string-append "src/" <> ".mes.i") snarf-bases)
381 ,@(map (cut string-append "src/" <> ".mes.environment.i") snarf-bases)))
383 (define gcc-snarf-targets
385 (add-target (snarf "src/gc.c" #:mes? #f))
386 (add-target (snarf "src/lib.c" #:mes? #f))
387 (add-target (snarf "src/math.c" #:mes? #f))
388 (add-target (snarf "src/mes.c" #:mes? #f))
389 (add-target (snarf "src/posix.c" #:mes? #f))
390 (add-target (snarf "src/reader.c" #:mes? #f))
391 (add-target (snarf "src/vector.c" #:mes? #f))))
393 (define mes-snarf-targets
395 (add-target (snarf "src/gc.c"))
396 (add-target (snarf "src/lib.c" #:mes? #t))
397 (add-target (snarf "src/math.c" #:mes? #t))
398 (add-target (snarf "src/mes.c" #:mes? #t))
399 (add-target (snarf "src/posix.c" #:mes? #t))
400 (add-target (snarf "src/reader.c" #:mes? #t))
401 (add-target (snarf "src/vector.c" #:mes? #t))))
403 (add-target (bin.gcc "src/mes.c" #:dependencies gcc-snarf-targets
404 #:defines `("FIXED_PRIMITIVES=1"
407 ,(string-append "VERSION=\"" %version "\"")
408 ,(string-append "MODULEDIR=\"" (string-append %prefix (if (string-null? %prefix) "" "/") %moduledir "/") "\"")
409 ,(string-append "PREFIX=\"" %prefix "\""))
410 #:includes '("src")))
412 (add-target (bin.gcc "src/mes.c" #:libc libc-gcc.mlibc-o
413 #:dependencies mes-snarf-targets
414 #:defines `("FIXED_PRIMITIVES=1"
416 ,(string-append "VERSION=\"" %version "\"")
417 ,(string-append "MODULEDIR=\"" (string-append %prefix (if (string-null? %prefix) "" "/") "/" %moduledir "/") "\"")
418 ,(string-append "PREFIX=\"" %prefix "\""))
419 #:includes '("src")))
421 (add-target (bin.mescc "src/mes.c" #:dependencies mes-snarf-targets
422 #:defines `("FIXED_PRIMITIVES=1"
424 ,(string-append "VERSION=\"" %version "\"")
425 ,(string-append "MODULEDIR=\"" (string-append %prefix (if (string-null? %prefix) "" "/") %moduledir "/") "\"")
426 ,(string-append "PREFIX=\"" %prefix "\""))
427 #:includes '("src")))
433 "tests/quasiquote.test"
448 "tests/let-syntax.test"
456 (define (add-mes.gcc-test o)
457 (add-target (target (file-name o)))
458 (add-target (check o #:dependencies (list (get-target "src/mes.mlibc-gcc")))))
460 (define (add-mes.guile-test o)
461 (add-target (target (file-name o)))
462 (add-target (check o #:dependencies (list (get-target "src/mes.guile")))))
464 ;; takes long, and should always pass if...
465 ;;(for-each add-mes.gcc-test mes-tests)
467 ;; ...mes.guile passes :-)
468 (for-each add-mes.guile-test mes-tests)
470 ;; FIXME: run tests/base.test
471 (setenv "MES" "src/mes.guile")
473 (add-target (install "guile/mescc.scm" #:dir "bin" #:substitutes #t))
474 (add-target (install "scripts/mescc.mes" #:dir "bin" #:substitutes #t))
475 (add-target (install "scripts/repl.mes" #:dir "bin" #:substitutes #t))
476 (define bootstrap? #f)
478 (add-target (install "src/mes.mes" #:dir "bin" #:installed-name "mes"))
479 (add-target (install "src/mes.guile" #:dir "bin" #:installed-name "mes")))
481 (define* ((install-dir #:key dir) name)
482 (add-target (install name #:dir (string-append dir "/" (dirname name)))))
484 (add-target (install "module/mes/base-0.mes" #:dir (string-append %moduledir "/mes") #:substitutes #t))
485 (add-target (install "module/language/c99/compiler.mes" #:dir (string-append %moduledir "/language/c99") #:substitutes #t))
487 (define %module-dir "share/mes")
490 ((install-dir #:dir (string-append %module-dir)) f))
491 '("module/language/c99/compiler.mes"
492 "module/language/c99/compiler.scm"
493 "module/language/c99/info.mes"
494 "module/language/c99/info.scm"
495 "module/language/paren.mes"
498 "module/mes/as-i386.mes"
499 "module/mes/as-i386.scm"
502 ;;"module/mes/base-0.mes"
503 "module/mes/base.mes"
504 "module/mes/bytevectors.mes"
505 "module/mes/bytevectors.scm"
506 "module/mes/catch.mes"
507 "module/mes/display.mes"
510 "module/mes/fluids.mes"
511 "module/mes/getopt-long.mes"
512 "module/mes/getopt-long.scm"
513 "module/mes/guile.mes"
514 "module/mes/lalr.mes"
515 "module/mes/lalr.scm"
517 "module/mes/match.mes"
518 "module/mes/match.scm"
519 "module/mes/optargs.mes"
520 "module/mes/optargs.scm"
522 "module/mes/peg/cache.scm"
523 "module/mes/peg/codegen.scm"
524 "module/mes/peg/simplify-tree.scm"
525 "module/mes/peg/string-peg.scm"
526 "module/mes/peg/using-parsers.scm"
527 "module/mes/pmatch.mes"
528 "module/mes/pmatch.scm"
529 "module/mes/posix.mes"
530 "module/mes/pretty-print.mes"
531 "module/mes/pretty-print.scm"
532 "module/mes/psyntax-0.mes"
533 "module/mes/psyntax-1.mes"
534 "module/mes/psyntax.mes"
535 "module/mes/psyntax.pp"
536 "module/mes/psyntax.ss"
537 "module/mes/quasiquote.mes"
538 "module/mes/quasisyntax.mes"
539 "module/mes/quasisyntax.scm"
540 "module/mes/read-0.mes"
541 "module/mes/record-0.mes"
542 "module/mes/record.mes"
543 "module/mes/repl.mes"
545 "module/mes/syntax.mes"
546 "module/mes/syntax.scm"
547 "module/mes/test.mes"
548 "module/mes/tiny-0.mes"
549 "module/mes/type-0.mes"
550 "module/nyacc/lalr.mes"
551 "module/nyacc/lang/c99/cpp.mes"
552 "module/nyacc/lang/c99/parser.mes"
553 "module/nyacc/lang/calc/parser.mes"
554 "module/nyacc/lang/util.mes"
555 "module/nyacc/lex.mes"
556 "module/nyacc/parse.mes"
557 "module/nyacc/util.mes"
558 "module/rnrs/arithmetic/bitwise.mes"
559 "module/srfi/srfi-0.mes"
560 "module/srfi/srfi-1.mes"
561 "module/srfi/srfi-1.scm"
562 "module/srfi/srfi-13.mes"
563 "module/srfi/srfi-14.mes"
564 "module/srfi/srfi-16.mes"
565 "module/srfi/srfi-16.scm"
566 "module/srfi/srfi-26.mes"
567 "module/srfi/srfi-26.scm"
568 "module/srfi/srfi-43.mes"
569 "module/srfi/srfi-9-psyntax.mes"
570 "module/srfi/srfi-9.mes"
571 "module/srfi/srfi-9.scm"
572 "module/sxml/xpath.mes"
573 "module/sxml/xpath.scm"))
575 (define* ((install-guile-dir #:key dir) name)
576 (add-target (install (string-append "guile/" name) #:dir (string-append dir "/" (dirname name)))))
580 ((install-guile-dir #:dir (string-append %guiledir)) f))
585 ((install-guile-dir #:dir (string-append %godir)) f))
588 (add-target (install "mlibc/crt1.hex2" #:dir "lib"))
589 (add-target (install "mlibc/libc-mes.M1" #:dir "lib"))
590 (add-target (install "mlibc/libc-mes.hex2" #:dir "lib"))
591 (add-target (install "mlibc/libc-mes+tcc.M1" #:dir "lib"))
592 (add-target (install "mlibc/libc-mes+tcc.hex2" #:dir "lib"))
593 (add-target (install "mlibc/mini-libc-mes.M1" #:dir "lib"))
594 (add-target (install "mlibc/mini-libc-mes.hex2" #:dir "lib"))
596 (add-target (install "mlibc/crt1.mlibc-o" #:dir "lib"))
597 (add-target (install "mlibc/libc-gcc.mlibc-o" #:dir "lib"))
598 (add-target (install "mlibc/libc-gcc+tcc.mlibc-o" #:dir "lib"))
602 ((install-dir #:dir "share/") f))
603 '("mlibc/include/alloca.h"
604 "mlibc/include/assert.h"
605 "mlibc/include/ctype.h"
606 "mlibc/include/dlfcn.h"
607 "mlibc/include/errno.h"
608 "mlibc/include/fcntl.h"
609 "mlibc/include/features.h"
610 "mlibc/include/inttypes.h"
611 "mlibc/include/libgen.h"
612 "mlibc/include/limits.h"
613 "mlibc/include/locale.h"
614 "mlibc/include/math.h"
615 "mlibc/include/mlibc.h"
616 "mlibc/include/setjmp.h"
617 "mlibc/include/signal.h"
618 "mlibc/include/stdarg.h"
619 "mlibc/include/stdbool.h"
620 "mlibc/include/stdint.h"
621 "mlibc/include/stdio.h"
622 "mlibc/include/stdlib.h"
623 "mlibc/include/stdnoreturn.h"
624 "mlibc/include/string.h"
625 "mlibc/include/strings.h"
626 "mlibc/include/sys/cdefs.h"
627 "mlibc/include/sys/mman.h"
628 "mlibc/include/sys/stat.h"
629 "mlibc/include/sys/time.h"
630 "mlibc/include/sys/timeb.h"
631 "mlibc/include/sys/types.h"
632 "mlibc/include/sys/ucontext.h"
633 "mlibc/include/sys/wait.h"
634 "mlibc/include/time.h"
635 "mlibc/include/unistd.h"))
638 (compose add-target (cut install <> #:dir "share/doc/mes"))
647 "doc/ANNOUNCE-0.10"))
649 (add-target (install "doc/fosdem/fosdem.pdf" #:dir "share/doc/mes"))
652 (cond ((member "all-go" args) #t)
653 ((member "clean-go" args) (map delete-file (filter file-exists? %go-files)))
654 ((member "clean" args) (clean))
655 ((member "list" args) (display (string-join (map target-file-name %targets) "\n" 'suffix)))
656 ((member "help" args) (format #t "Usage: ./make.scm [TARGET]...
668 (string-join (filter (negate (cut string-index <> #\/)) (map target-file-name %targets)) "\n " 'prefix)))
670 (let ((targets (match args
671 (() (filter (conjoin (negate install-target?)
672 (negate check-target?))
674 ((? (cut member "all" <>)) (filter (conjoin (negate install-target?)
675 (negate check-target?))
677 ((? (cut member "check" <>)) (filter check-target? %targets))
678 ((? (cut member "install" <>)) (filter install-target? %targets))
679 (_ (filter-map (cut get-target <>) args)))))
680 ;;((@@ (guix make) store) #:print 0)
681 (for-each build targets)
684 (main (cdr (command-line)))