File: libpath.zuo

package info (click to toggle)
chezscheme 10.0.0%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 36,908 kB
  • sloc: ansic: 24,192; sh: 1,132; makefile: 386; csh: 368; asm: 168
file content (18 lines) | stat: -rw-r--r-- 536 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#lang zuo

(command-line
 :args
 (srcdir)
 (lambda (accum)
   (define norm-srcdir (apply build-path (explode-path srcdir)))
   (define lines (string-split (file->string (build-path srcdir "zuo.c"))
			       "\n"))
   (define out (fd-open-output "zuo.c" :truncate))
   (for-each
    (let ([def? (glob->matcher "# define ZUO_LIB_PATH*")])
      (lambda (line)
	(if (def? line)
	    (fd-write out (~a "# define ZUO_LIB_PATH " (~s (build-path norm-srcdir "lib")) "\n"))
	    (fd-write out (~a line "\n")))))
    lines)
   (fd-close out)))