diff --git a/.gitignore b/.gitignore index 4e54a11..fb9b83c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ *.o *.so *.import.scm +brmsaptool diff --git a/Makefile b/Makefile index 2ad3ef4..538c892 100644 --- a/Makefile +++ b/Makefile @@ -23,43 +23,48 @@ # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # +brmsaptool: brmsaptool.o testing.o listing.o month.o period.o ansi.o \ + member-file.o dictionary.o command-line.o + csc -o brmsaptool $^ -.PHONY: all -all: testing.so testing.import.scm listing.so listing.import.scm \ - month.so month.import.scm period.so period.import.scm \ - ansi.so ansi.import.scm member-file.so \ - member-file.import.scm dictionary.so \ - dictionary.import.scm +.PHONY: clean +clean: + rm -f *.o *.import.scm brmsaptool ################################################################ # Module shared object and import source compilation -%.so: %.scm - csc -s $< +%.o: %.scm + csc -c $< %.import.scm: %.scm - csc -J $< + csc -c -J $< ################################################################ # Modules -testing.so: testing.scm +testing.o: testing.scm testing.import.scm: testing.scm -listing.so: listing.scm -listing.import.scm: listing.scm +listing.o: listing.scm testing.import.scm +listing.import.scm: listing.scm testing.import.scm -dictionary.so: dictionary.scm -dictionary.import.scm: dictionary.scm +dictionary.o: dictionary.scm testing.import.scm +dictionary.import.scm: dictionary.scm testing.import.scm -month.so: month.scm -month.import.scm: month.scm +month.o: month.scm testing.import.scm +month.import.scm: month.scm testing.import.scm -period.so: period.scm -period.import.scm: period.scm +period.o: period.scm testing.import.scm month.import.scm +period.import.scm: period.scm testing.import.scm month.import.scm -ansi.so: ansi.scm -ansi.import.scm: ansi.scm +ansi.o: ansi.scm testing.import.scm +ansi.import.scm: ansi.scm testing.import.scm -member-file.so: member-file.scm dictionary.import.scm ansi.import.scm -member-file.import.scm: member-file.scm dictionary.import.scm ansi.import.scm +member-file.o: member-file.scm dictionary.import.scm ansi.import.scm month.import.scm period.import.scm listing.import.scm testing.import.scm +member-file.import.scm: member-file.scm dictionary.import.scm ansi.import.scm month.import.scm period.import.scm listing.import.scm testing.import.scm + +command-line.o: command-line.scm testing.import.scm +command-line.import.scm: command-line.scm testing.import.scm + +brmsaptool.o: brmsaptool.scm testing.import.scm listing.import.scm dictionary.import.scm month.import.scm period.import.scm ansi.import.scm member-file.import.scm command-line.import.scm diff --git a/ansi.scm b/ansi.scm index 9c04ad1..04bafcf 100644 --- a/ansi.scm +++ b/ansi.scm @@ -23,6 +23,8 @@ ;; CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ;; +(declare (unit ansi)) + (module ansi ( diff --git a/brmsaptool.scm b/brmsaptool.scm index fb7d659..c757fe5 100644 --- a/brmsaptool.scm +++ b/brmsaptool.scm @@ -23,6 +23,15 @@ ;; CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ;; +;(declare (uses testing +; listing +; dictionary +; month +; period +; member-file +; command-line +; ansi)) + (import testing listing dictionary diff --git a/brmsaptool.sh b/brmsaptool.sh index 3216b26..f4543f2 100644 --- a/brmsaptool.sh +++ b/brmsaptool.sh @@ -1,4 +1,28 @@ #!/bin/sh +# +# brmsaptool.sh +# +# Runs the tool as Scheme script using csi. +# +# ISC License +# +# Copyright 2023 Brmlab, z.s. +# Dominik Pantůček +# +# Permission to use, copy, modify, and/or distribute this software +# for any purpose with or without fee is hereby granted, provided +# that the above copyright notice and this permission notice appear +# in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL +# WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE +# AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR +# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +# OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# csi -q -b \ testing.scm \ diff --git a/command-line.scm b/command-line.scm index 7b660be..ebd1470 100644 --- a/command-line.scm +++ b/command-line.scm @@ -23,6 +23,8 @@ ;; CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ;; +(declare (unit command-line)) + (module command-line (command-line diff --git a/dictionary.scm b/dictionary.scm index 5613e12..fadfd0c 100644 --- a/dictionary.scm +++ b/dictionary.scm @@ -23,6 +23,8 @@ ;; CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ;; +(declare (unit dictionary)) + (module dictionary ( diff --git a/listing.scm b/listing.scm index 55268ae..2034afc 100644 --- a/listing.scm +++ b/listing.scm @@ -23,6 +23,8 @@ ;; CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ;; +(declare (unit listing)) + (module listing (print-source-listing listing-tests!) diff --git a/member-file.scm b/member-file.scm index b681b57..61e805d 100644 --- a/member-file.scm +++ b/member-file.scm @@ -23,6 +23,8 @@ ;; CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ;; +(declare (unit member-file)) + (module member-file ( diff --git a/month.scm b/month.scm index 64fe74e..1703799 100644 --- a/month.scm +++ b/month.scm @@ -23,6 +23,8 @@ ;; CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ;; +(declare (unit month)) + (module month ( diff --git a/period.scm b/period.scm index b134968..c2f6e91 100644 --- a/period.scm +++ b/period.scm @@ -23,6 +23,8 @@ ;; CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ;; +(declare (unit period)) + (module period ( diff --git a/testing.scm b/testing.scm index a12c1d1..9982f0e 100644 --- a/testing.scm +++ b/testing.scm @@ -23,6 +23,8 @@ ;; CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ;; +(declare (unit testing)) + (module testing (test-eq? test-equal? test-exn test-true test-false run-tests)