projects
/
rrq
/
newlisp
/
packnl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Initial setup.
[rrq/newlisp/packnl.git]
/
packnl.lsp
diff --git
a/packnl.lsp
b/packnl.lsp
index d8adb2ea947258a04cf207b7f208e14dc55b37d6..3e20f2b74f984e8874d82edbd36b01dabeee4c6d 100644
(file)
--- a/
packnl.lsp
+++ b/
packnl.lsp
@@
-2,7
+2,9
@@
;; binary, which is an embedded newlisp binary with the same embedding
;; script as binnl itself.
;;
;; binary, which is an embedded newlisp binary with the same embedding
;; script as binnl itself.
;;
-;; Usage: [ -r ] binary ( member | -a archive | -C dir )*
+;; Usage: -w binary ( member | -a archive | -A archive | -C dir )*
+;; -t binary
+;; -u binary directory
;;
;; The script processes the arguments from left to right to form then
;; named binary with the named members appended.
;;
;; The script processes the arguments from left to right to form then
;; named binary with the named members appended.
@@
-15,7
+17,7
@@
;;
;; Use '-C dir' to change source directory
;;
;;
;; Use '-C dir' to change source directory
;;
-;; Use '-
r
' to overwrite an existing binary
+;; Use '-
w
' to overwrite an existing binary
;; The first embedded member will be the "main script".
;;
;; The first embedded member will be the "main script".
;;
@@
-31,14
+33,20
@@
(define (compile-file M (D (read-file M)))
(unless D
(define (compile-file M (D (read-file M)))
(unless D
- (write-line 2 (format "*** Mising %s .. aborting" M))
+ (write-line 2 (format "*** Cannot read %s .. aborting" M))
+ (when (and (archives M) (not (ends-with (archives M) ".a")))
+ (write-line 2 (format "*** (Archive filename %s must end with \".a\")"
+ (archives M))))
(exit 1))
(append-file BINARY (format "%s\n%d\n" M (length D)))
(append-file BINARY D))
(define (compile-ar A M)
(let ((MEMBERS (archive M)))
(exit 1))
(append-file BINARY (format "%s\n%d\n" M (length D)))
(append-file BINARY D))
(define (compile-ar A M)
(let ((MEMBERS (archive M)))
- (if (= A "-A") (dolist (M MEMBERS) (compile-file M)))))
+ (dolist (X MEMBERS)
+ ;;(write-line 2 (format "including %s from %s" X M))
+ (when (= A "-A") (compile-file X))
+ )))
(define (compile BINARY MEMBERS)
(unless (starts-with BINARY "/")
(define (compile BINARY MEMBERS)
(unless (starts-with BINARY "/")
@@
-47,7
+55,6
@@
(exec (format "chmod a+x %s" BINARY))
(let ((A nil) (C nil))
(dolist (M MEMBERS)
(exec (format "chmod a+x %s" BINARY))
(let ((A nil) (C nil))
(dolist (M MEMBERS)
- ;;(write-line 1 (string "[" M "]" (archives)))
(case M
("-a" (setf A "-a"))
("-A" (setf A "-A"))
(case M
("-a" (setf A "-a"))
("-A" (setf A "-A"))