2005-02-04 03:05:55 -05:00
|
|
|
(define image-dir "../../image")
|
|
|
|
(define prefix (string-append image-dir "/" "usr"))
|
|
|
|
(define my-lib-dir (string-append prefix "/" "lib"))
|
|
|
|
(define my-bin-dir (string-append prefix "/" "bin"))
|
|
|
|
(define my-share-dir (string-append prefix "/" "share"))
|
|
|
|
(define my-doc-dir (string-append my-share-dir "/" "doc"))
|
|
|
|
(define my-install-doc-dir (string-append my-doc-dir "/" "show-sqrt-1.0"))
|
|
|
|
|
|
|
|
(define clean-files
|
|
|
|
(list "wildio.o" "mymath.o"
|
|
|
|
"libwildio.so.1.0" "libmymath.so.1.0"
|
|
|
|
"libwildio.so.1" "libmymath.so.1"
|
|
|
|
"libwildio.so" "libmymath.so"
|
|
|
|
"show-sqrt"
|
|
|
|
"manual.dvi" "manual.pdf" "manual.log" "manual.aux"))
|
|
|
|
|
2005-02-15 14:03:05 -05:00
|
|
|
(define file-set
|
2005-02-04 03:05:55 -05:00
|
|
|
(makefile
|
|
|
|
;;
|
2005-02-15 14:03:05 -05:00
|
|
|
;; create a configfile
|
|
|
|
;;
|
|
|
|
(md5 "config.h"
|
|
|
|
()
|
|
|
|
(let ((outport (open-output-file ($@))))
|
|
|
|
(with-current-output-port outport
|
|
|
|
(display "#ifndef MY_DELTA_MAX\n")
|
|
|
|
(display "#define MY_DELTA_MAX 0.000000001\n")
|
|
|
|
(display "#endif\n")
|
|
|
|
(close-output-port outport))))
|
|
|
|
;;
|
2005-02-04 03:05:55 -05:00
|
|
|
;; build libmymath.*
|
|
|
|
;;
|
2005-02-15 14:03:05 -05:00
|
|
|
(file "mymath.o"
|
|
|
|
("mymath.c" "config.h")
|
|
|
|
(run (gcc -fPIC -c ,($<))))
|
|
|
|
(file "libmymath.so.1.0"
|
2005-02-04 03:05:55 -05:00
|
|
|
("mymath.o")
|
2005-02-15 14:03:05 -05:00
|
|
|
(run (gcc -shared ,"-Wl,-soname,libmymath.so.1" -o ,($@) ,($<))))
|
2005-02-04 03:05:55 -05:00
|
|
|
;;
|
|
|
|
;; build wildio.*
|
|
|
|
;;
|
2005-02-15 14:03:05 -05:00
|
|
|
(file "wildio.o"
|
2005-02-04 03:05:55 -05:00
|
|
|
("wildio.c")
|
2005-02-15 14:03:05 -05:00
|
|
|
(run (gcc -fPIC -c ,($<))))
|
|
|
|
(file "libwildio.so.1.0"
|
2005-02-04 03:05:55 -05:00
|
|
|
("wildio.o")
|
2005-02-15 14:03:05 -05:00
|
|
|
(run (gcc -shared "-Wl,-soname,libwildio.so.1" -o ,($@) ,($<))))
|
2005-02-04 03:05:55 -05:00
|
|
|
;;
|
|
|
|
;; build the program
|
|
|
|
;;
|
2005-02-15 14:03:05 -05:00
|
|
|
(md5 "show-sqrt"
|
|
|
|
("main.c" "libmymath.so.1" "libwildio.so.1" "wildio.h" "mymath.h")
|
|
|
|
(run (gcc -L ,(cwd) -L ,my-lib-dir -rdynamic
|
|
|
|
-o ,($@) ,($<) ,"libwildio.so.1" ,"libmymath.so.1" -ldl)))
|
2005-02-04 03:05:55 -05:00
|
|
|
;;
|
|
|
|
;; install libs
|
|
|
|
;;
|
2005-02-15 14:03:05 -05:00
|
|
|
(file "libmymath.so.1"
|
2005-02-04 03:05:55 -05:00
|
|
|
("libmymath.so.1.0")
|
2005-02-15 14:03:05 -05:00
|
|
|
(create-symlink ($<) ($@)))
|
|
|
|
(file "libmymath.so"
|
2005-02-04 03:05:55 -05:00
|
|
|
("libmymath.so.1")
|
2005-02-15 14:03:05 -05:00
|
|
|
(create-symlink ($<) ($@)))
|
|
|
|
(file "libwildio.so.1"
|
2005-02-04 03:05:55 -05:00
|
|
|
("libwildio.so.1.0")
|
2005-02-15 14:03:05 -05:00
|
|
|
(create-symlink ($<) ($@)))
|
|
|
|
(file "libwildio.so"
|
2005-02-04 03:05:55 -05:00
|
|
|
("libwildio.so.1")
|
2005-02-15 14:03:05 -05:00
|
|
|
(create-symlink ($<) ($@)))
|
|
|
|
(file (string-append my-lib-dir "/" "libmymath.so.1")
|
2005-02-04 03:05:55 -05:00
|
|
|
((string-append my-lib-dir "/" "libmymath.so.1.0"))
|
2005-02-15 14:03:05 -05:00
|
|
|
(with-cwd ($@/) (create-symlink (/$<) (/$@))))
|
|
|
|
(file (string-append my-lib-dir "/" "libmymath.so")
|
2005-02-04 03:05:55 -05:00
|
|
|
((string-append my-lib-dir "/" "libmymath.so.1"))
|
2005-02-15 14:03:05 -05:00
|
|
|
(with-cwd ($@/) (create-symlink (/$<) (/$@))))
|
|
|
|
(file (string-append my-lib-dir "/" "libwildio.so.1")
|
2005-02-04 03:05:55 -05:00
|
|
|
((string-append my-lib-dir "/" "libwildio.so.1.0"))
|
2005-02-15 14:03:05 -05:00
|
|
|
(with-cwd ($@/) (create-symlink (/$<) (/$@))))
|
|
|
|
(file (string-append my-lib-dir "/" "libwildio.so")
|
2005-02-04 03:05:55 -05:00
|
|
|
((string-append my-lib-dir "/" "libwildio.so.1"))
|
2005-02-15 14:03:05 -05:00
|
|
|
(with-cwd ($@/) (create-symlink (/$<) (/$@))))
|
|
|
|
(file (string-append my-lib-dir "/" "libwildio.so.1.0")
|
|
|
|
("libwildio.so.1.0" my-lib-dir)
|
|
|
|
(run (cp ,($<) ,($@))))
|
|
|
|
(file (string-append my-lib-dir "/" "libmymath.so.1.0")
|
|
|
|
("libmymath.so.1.0" my-lib-dir)
|
|
|
|
(run (cp ,($<) ,($@))))
|
2005-02-04 03:05:55 -05:00
|
|
|
;;
|
|
|
|
;; install the program
|
|
|
|
;;
|
2005-02-15 14:03:05 -05:00
|
|
|
(file (string-append my-bin-dir "/" "show-sqrt")
|
|
|
|
("show-sqrt" my-bin-dir)
|
|
|
|
(run (cp ,($<) ,($@))))
|
2005-02-04 03:05:55 -05:00
|
|
|
;;
|
|
|
|
;; build the manual
|
|
|
|
;;
|
|
|
|
(md5 "manual.dvi"
|
|
|
|
("manual.tex")
|
2005-02-15 14:03:05 -05:00
|
|
|
(run (latex ,($<))))
|
|
|
|
(file "manual.pdf"
|
2005-02-04 03:05:55 -05:00
|
|
|
("manual.dvi")
|
2005-02-15 14:03:05 -05:00
|
|
|
(run (dvipdfm -o ,($@) ,($<))))
|
2005-02-04 03:05:55 -05:00
|
|
|
;;
|
|
|
|
;; install the manual
|
|
|
|
;;
|
2005-02-15 14:03:05 -05:00
|
|
|
(file (string-append my-install-doc-dir "/" "manual.pdf")
|
|
|
|
("manual.pdf" my-install-doc-dir)
|
|
|
|
(run (cp ,($<) ,($@))))
|
2005-02-04 03:05:55 -05:00
|
|
|
;;
|
|
|
|
;; install all
|
|
|
|
;;
|
2005-02-15 14:03:05 -05:00
|
|
|
(always "install"
|
|
|
|
((string-append my-lib-dir "/" "libmymath.so.1.0")
|
|
|
|
(string-append my-lib-dir "/" "libwildio.so.1.0")
|
|
|
|
(string-append my-lib-dir "/" "libmymath.so.1")
|
|
|
|
(string-append my-lib-dir "/" "libwildio.so.1")
|
|
|
|
(string-append my-lib-dir "/" "libmymath.so")
|
|
|
|
(string-append my-lib-dir "/" "libwildio.so")
|
|
|
|
(string-append my-bin-dir "/" "show-sqrt")
|
|
|
|
(string-append my-install-doc-dir "/" "manual.pdf"))
|
|
|
|
(display "install done.\n"))
|
2005-02-04 03:05:55 -05:00
|
|
|
;;
|
2005-02-15 14:03:05 -05:00
|
|
|
;; clean files
|
2005-02-04 03:05:55 -05:00
|
|
|
;;
|
|
|
|
(always "clean"
|
|
|
|
()
|
2005-02-15 14:03:05 -05:00
|
|
|
(for-each (lambda (f)
|
|
|
|
(delete-filesys-object (expand-file-name f (cwd))))
|
|
|
|
clean-files))
|
2005-02-04 03:05:55 -05:00
|
|
|
;;
|
2005-02-15 14:03:05 -05:00
|
|
|
;; clean files
|
2005-02-04 03:05:55 -05:00
|
|
|
;;
|
|
|
|
(always "mrproper"
|
|
|
|
("clean")
|
2005-02-15 14:03:05 -05:00
|
|
|
(for-each (lambda (f)
|
|
|
|
(delete-filesys-object (expand-file-name f (cwd))))
|
|
|
|
(list "checksums.md5")))
|
2005-02-04 03:05:55 -05:00
|
|
|
;;
|
|
|
|
;; uninstall all
|
|
|
|
;;
|
|
|
|
(always "uninstall"
|
2005-02-15 14:03:05 -05:00
|
|
|
("clean")
|
|
|
|
(begin
|
|
|
|
(display "uninstall: \n")
|
|
|
|
(for-each (lambda (f)
|
|
|
|
(display "remove: ") (display f) (newline)
|
|
|
|
(delete-filesys-object f))
|
|
|
|
(list (string-append my-lib-dir "/" "libmymath.so.1.0")
|
|
|
|
(string-append my-lib-dir "/" "libwildio.so.1.0")
|
|
|
|
(string-append my-lib-dir "/" "libmymath.so.1")
|
|
|
|
(string-append my-lib-dir "/" "libwildio.so.1")
|
|
|
|
(string-append my-lib-dir "/" "libmymath.so")
|
|
|
|
(string-append my-lib-dir "/" "libwildio.so")
|
|
|
|
(string-append my-bin-dir "/" "show-sqrt")
|
|
|
|
(string-append my-install-doc-dir "/" "manual.pdf")
|
|
|
|
my-install-doc-dir
|
|
|
|
my-doc-dir
|
|
|
|
my-share-dir
|
|
|
|
my-lib-dir
|
|
|
|
my-bin-dir
|
|
|
|
prefix
|
|
|
|
image-dir))
|
|
|
|
(display "uninstall done.\n")))
|
2005-02-04 03:05:55 -05:00
|
|
|
;;
|
|
|
|
;; install dirs
|
|
|
|
;;
|
|
|
|
(once image-dir
|
|
|
|
()
|
2005-02-15 14:03:05 -05:00
|
|
|
(create-directory image-dir))
|
2005-02-04 03:05:55 -05:00
|
|
|
(once prefix
|
|
|
|
(image-dir)
|
2005-02-15 14:03:05 -05:00
|
|
|
(create-directory prefix))
|
2005-02-04 03:05:55 -05:00
|
|
|
(once my-lib-dir
|
|
|
|
(prefix)
|
2005-02-15 14:03:05 -05:00
|
|
|
(create-directory my-lib-dir))
|
2005-02-04 03:05:55 -05:00
|
|
|
(once my-bin-dir
|
|
|
|
(prefix)
|
2005-02-15 14:03:05 -05:00
|
|
|
(create-directory my-bin-dir))
|
2005-02-04 03:05:55 -05:00
|
|
|
(once my-share-dir
|
|
|
|
(prefix)
|
2005-02-15 14:03:05 -05:00
|
|
|
(create-directory my-share-dir))
|
2005-02-04 03:05:55 -05:00
|
|
|
(once my-doc-dir
|
|
|
|
(my-share-dir)
|
2005-02-15 14:03:05 -05:00
|
|
|
(create-directory my-doc-dir))
|
2005-02-04 03:05:55 -05:00
|
|
|
(once my-install-doc-dir
|
|
|
|
(my-doc-dir)
|
2005-02-15 14:03:05 -05:00
|
|
|
(create-directory my-install-doc-dir))
|
2005-02-04 03:05:55 -05:00
|
|
|
;;
|
|
|
|
;; a small test
|
|
|
|
;;
|
|
|
|
(always "test"
|
|
|
|
("install")
|
2005-02-15 14:03:05 -05:00
|
|
|
(let ((proggy (expand-file-name "show-sqrt" my-bin-dir)))
|
|
|
|
(display "testing ") (display proggy) (newline)
|
|
|
|
(setenv "LD_LIBRARY_PATH" my-lib-dir)
|
|
|
|
(display "# sqrt 2.0:\n")
|
|
|
|
(run (,proggy ,"2.0"))
|
|
|
|
(display "# sqrt 5.0:\n")
|
|
|
|
(run (,proggy ,"5.0"))
|
|
|
|
(display "ok.\n")))))
|