*** empty log message ***
authorhachti <hachti>
Mon, 19 Dec 2005 02:42:35 +0000 (02:42 +0000)
committerhachti <hachti>
Mon, 19 Dec 2005 02:42:35 +0000 (02:42 +0000)
13 files changed:
lib/fortran/Makefile
lib/fortran/buildlib.sh [new file with mode: 0755]
lib/fortran/flib3.akt [deleted file]
lib/fortran/mkrecipe.sh [new file with mode: 0755]
lib/fortran/original/flib1 [deleted file]
lib/fortran/original/flib1.lib [new file with mode: 0644]
lib/fortran/original/flib2 [deleted file]
lib/fortran/original/flib2.lib [new file with mode: 0644]
lib/fortran/original/flib3 [deleted file]
lib/fortran/original/flib3.lib [new file with mode: 0644]
lib/fortran/original/for-lib-2s-14-rev-01-316+516-2(sw)of3-objects.ptp [deleted file]
lib/fortran/original/fort-lib-1-12-rev-01-tape-1of3-objects.ptp [deleted file]
lib/fortran/original/fort-lib-3-15-rev-02-3+516-tape-3of3.objects.ptp [deleted file]

index aaec19e86c4a10fa811c391c316bcb7a14737fc7..fa8736d3cd72a26f523bcb1cf7ea3dd0a663e850 100644 (file)
@@ -16,10 +16,8 @@ OBJ_FILES_FULL = $(foreach file, $(OBJ_FILES),$(OBJ_DIR)/$(file))
 
 ##########################################
 
-all : $(OBJ_FILES_FULL)
-
-test:
-       @echo $(OBJ_FILES)
+default : $(OBJ_FILES_FULL)
+       buildlib.sh
 
 
 $(OBJ_FILES_FULL):$(OBJ_DIR)/%.obj:$(SRC_DIR)/%.asm
@@ -33,7 +31,7 @@ clean:
        @rm -rf $(OBJ_DIR) $(LIB_DIR)  *.lst *.go 
        @rm -f $(SRC_DIR)/vpunch.asm $(SRC_DIR)/vpunch.2
        @$(MAKE) -s  -C vpunch-help clean
-       @rm -r org
+       @buildlib.sh clean
 
 vpunch-help/use: vpunch-help/use.c vpunch-help/font_8x16.c
        $(MAKE) -C vpunch-help use
@@ -45,7 +43,7 @@ src/vpunch.asm: src/vpunch.1 src/vpunch.2
        cat src/vpunch.1 src/vpunch.2 > src/vpunch.asm
 
 org:
-       makeorg.sh
+       ./makeorg.sh
 
 .PHONY: clean all org
 
diff --git a/lib/fortran/buildlib.sh b/lib/fortran/buildlib.sh
new file mode 100755 (executable)
index 0000000..0341691
--- /dev/null
@@ -0,0 +1,84 @@
+#!/bin/bash
+
+# Here we find the recipes for the libraries.
+RECIPE_DIR=recipe
+
+# And their file suffix
+RECIPE_SUFFIX=.recipe
+
+# Here go the new libraries
+OUTPUT_DIR=./lib
+
+# This is needed as end-of-tape block for the loader
+ENDBLOCK=$H316/snippets/endseq
+
+# Where to get the original libraries:
+ORG_LIBDIR=original
+
+# And where to store the original objects
+ORG_OBJDIR=org
+
+# The suffix for library files (in and out)
+LIB_SUFFIX=.lib
+#######################################################################
+
+
+# Clean everything up
+clean() {
+    rm -rf $OUTPUT_DIR $ORG_OBJDIR
+}
+
+# Generate org directory containing the original library objects
+make_org() {
+    if [ ! -d "$ORG_OBJDIR" ]; then
+       mkdir  $ORG_OBJDIR
+    fi
+    tdir=$PWD
+    cd $ORG_OBJDIR
+    cat $tdir/$ORG_LIBDIR/*$LIB_SUFFIX | ldc -s
+    cd $tdir
+}
+
+genlib(){
+    echo "Library Builder start."
+    if [ ! -d "$OUTPUT_DIR" ]; then
+       echo -n "Creating $OUTPUT_DIR:"
+       mkdir  $OUTPUT_DIR && echo "Ok." || echo "FAILED!"
+    fi
+    
+    
+    
+    RECIPE_LIST=`ls $RECIPE_DIR/*$RECIPE_SUFFIX`
+    for recipe in $RECIPE_LIST; do
+       lib=$OUTPUT_DIR/`basename $recipe $RECIPE_SUFFIX`$LIB_SUFFIX
+       echo "Building $lib:"
+       rm -f $lib
+       for item in `cat $recipe`; do
+           echo "appending $item."
+           cat $item >> $lib || (echo "Error! could not find:$item")
+        done   
+           cat $ENDBLOCK >> $lib
+    done
+}
+    
+
+case $1 in
+    clean)
+       echo "Clean!"
+       clean
+    ;;
+    makeorg)
+       echo "Make org!"
+       make_org
+    ;;
+    lib)
+       echo "Build Lib!"
+       genlib
+    ;;
+    *)
+       clean
+       make_org
+       genlib
+    ;;
+esac
+
diff --git a/lib/fortran/flib3.akt b/lib/fortran/flib3.akt
deleted file mode 100644 (file)
index bf3fe40..0000000
Binary files a/lib/fortran/flib3.akt and /dev/null differ
diff --git a/lib/fortran/mkrecipe.sh b/lib/fortran/mkrecipe.sh
new file mode 100755 (executable)
index 0000000..8b24918
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# Stelle Rezept für die gegebene Bibliothek her
+
+IFS="
+"
+
+lines=`ldc $1 | egrep "^[A-Z].*\((6)|0-0|0-14|4\)"`
+state=0
+
+for line in $lines; do
+    case $state in 0)
+       if echo $line | egrep "^[A-Z].*\((6)|0-0\)" > /dev/null; then
+           echo `echo $line|awk '{printf("org/%s\n",$1);}'` 
+           state=1
+#          echo state up
+       fi
+       ;;
+       1)
+           if echo $line | egrep "^.*\((4)|0-14\)" > /dev/null; then
+               state=0
+           fi
+       ;;
+    esac
+done
\ No newline at end of file
diff --git a/lib/fortran/original/flib1 b/lib/fortran/original/flib1
deleted file mode 100644 (file)
index 642217c..0000000
Binary files a/lib/fortran/original/flib1 and /dev/null differ
diff --git a/lib/fortran/original/flib1.lib b/lib/fortran/original/flib1.lib
new file mode 100644 (file)
index 0000000..642217c
Binary files /dev/null and b/lib/fortran/original/flib1.lib differ
diff --git a/lib/fortran/original/flib2 b/lib/fortran/original/flib2
deleted file mode 100644 (file)
index b3da100..0000000
Binary files a/lib/fortran/original/flib2 and /dev/null differ
diff --git a/lib/fortran/original/flib2.lib b/lib/fortran/original/flib2.lib
new file mode 100644 (file)
index 0000000..b3da100
Binary files /dev/null and b/lib/fortran/original/flib2.lib differ
diff --git a/lib/fortran/original/flib3 b/lib/fortran/original/flib3
deleted file mode 100644 (file)
index 80e1611..0000000
Binary files a/lib/fortran/original/flib3 and /dev/null differ
diff --git a/lib/fortran/original/flib3.lib b/lib/fortran/original/flib3.lib
new file mode 100644 (file)
index 0000000..80e1611
Binary files /dev/null and b/lib/fortran/original/flib3.lib differ
diff --git a/lib/fortran/original/for-lib-2s-14-rev-01-316+516-2(sw)of3-objects.ptp b/lib/fortran/original/for-lib-2s-14-rev-01-316+516-2(sw)of3-objects.ptp
deleted file mode 100644 (file)
index b3da100..0000000
Binary files a/lib/fortran/original/for-lib-2s-14-rev-01-316+516-2(sw)of3-objects.ptp and /dev/null differ
diff --git a/lib/fortran/original/fort-lib-1-12-rev-01-tape-1of3-objects.ptp b/lib/fortran/original/fort-lib-1-12-rev-01-tape-1of3-objects.ptp
deleted file mode 100644 (file)
index 642217c..0000000
Binary files a/lib/fortran/original/fort-lib-1-12-rev-01-tape-1of3-objects.ptp and /dev/null differ
diff --git a/lib/fortran/original/fort-lib-3-15-rev-02-3+516-tape-3of3.objects.ptp b/lib/fortran/original/fort-lib-3-15-rev-02-3+516-tape-3of3.objects.ptp
deleted file mode 100644 (file)
index 80e1611..0000000
Binary files a/lib/fortran/original/fort-lib-3-15-rev-02-3+516-tape-3of3.objects.ptp and /dev/null differ