Build Script
This is a simple build script for your program.
- Assume your program is named foo
- Assume it must use some packages from a library called "scsh-utils"
- Assume your programs local packages are in src/packages.scm
#!/usr/local/bin/scsh \
-lm ../scsh-utils/interfaces.scm -lm ../scsh-utils/packages.scm -lm src/packages.scm -o foo -e main -s
!#
(define image-header "#!/usr/local/lib/scsh/scshvm \\\n-o /usr/local/lib/scsh/scshvm -i\n")
(define main
(lambda (args)
(with-current-output-port
(open-output-file "bin/foo.header")
(display image-header))
(dump-scsh-program foo "bin/foo.image")
(run (cat "bin/foo.header" "bin/foo.image") (> "bin/foo"))
(set-file-mode "bin/foo" #o755)
(delete-file "bin/foo.header")
(delete-file "bin/foo.image")
(display "done")
(newline)))
This code snippet brought to you by Anthony Carrico.
BuildScript - raw wiki source |
code snippets archive
|