*** empty log message ***
authorhachti <hachti>
Mon, 2 Jan 2006 21:33:31 +0000 (21:33 +0000)
committerhachti <hachti>
Mon, 2 Jan 2006 21:33:31 +0000 (21:33 +0000)
bin/mkrecipe.sh [new file with mode: 0755]
lib/fortran/Makefile
lib/fortran/mkrecipe.sh [deleted file]
lib/iolib/Makefile
lib/iolib/buildlib.sh [new file with mode: 0755]
lib/iolib/original/io-base.lib [new file with mode: 0644]
lib/iolib/recipe/io.recipe [new file with mode: 0644]
pc-tools/ldc/Makefile

diff --git a/bin/mkrecipe.sh b/bin/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
index 1513de4dc6c5e096845b51fae569f45b62940763..2862bf94e4c79597adf127ddada8ee9ac237afab 100644 (file)
@@ -46,8 +46,5 @@ src/vpunch.2: vpunch-help/use
 src/vpunch.asm: src/vpunch.1 src/vpunch.2
        cat src/vpunch.1 src/vpunch.2 > src/vpunch.asm
 
-org:
-       ./makeorg.sh
-
 .PHONY: clean all org obj libs
 
diff --git a/lib/fortran/mkrecipe.sh b/lib/fortran/mkrecipe.sh
deleted file mode 100755 (executable)
index 8b24918..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/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
index ae5956688958a38828e0b433cd8e72b77fd79202..f9c684612ba6c494007f12672463c8321377092c 100644 (file)
@@ -1,38 +1,39 @@
-# Skript, das die neue Bibliothek zusammenbauen soll 
+# Skript, das die neue Bibliothek zusammenbauen soll (01.01.06)
 
-OWN =  o$$al  o$$la o$$pl o$$pb i$$pa
-OWN_1=$(foreach obj, $(OWN),$(obj).asm)
-OWN_2=$(OWN_1:.asm=.obj)
-OWN_3=$(shell echo $(subst $$,\$$,$(OWN)) | dd conv=ucase 2>/dev/null) 
+SRC_DIR = src
+OBJ_DIR = obj
+LIB_DIR = lib
 
-ORG_USE=I$$AB I$$AI O$$AI O$$AB 
-ASM=$H316/bin/asm
+MODULES = o$$al  o$$la o$$pl o$$pb i$$pa
 
-##########################################
+FRTN_COMMAND = frtn
+ASM_COMMAND  = asm
+LDC_COMMAND  = ldc
 
-all: io.lib
+SRC_FILES = $(foreach obj, $(MODULES),$(obj).asm)
+OBJ_FILES = $(SRC_FILES:.asm=.obj)
+OBJ_FILES_FULL = $(foreach file, $(OBJ_FILES),$(OBJ_DIR)/$(file))
 
-io.lib: $(foreach org, $(ORG_USE), original/$(org)) $(OWN_3)
-       @echo Baue Bibliothek endgültig zusammen.
-       cat $(subst $$,\$$,\
-          $(OWN_3)\
-          $(foreach og, $(ORG_USE),original/$(og))\
-       )\
-       $(H316)/snippets/endseq \
-       > io.lib || rm io.lib
+##########################################
 
-obj object objects : $(OWN_2)
+libs : $(OBJ_FILES_FULL)
+       buildlib.sh
 
-$(OWN_3): $(OWN_2)
-       cat $(subst $$,\$$,$(OWN_2)) | ldc -s -l
+obj : $(OBJ_FILES_FULL)
 
-$(OWN_2):%.obj:src/%.asm
-       asm $(subst $$,\$$,$^)
+$(OBJ_FILES_FULL):$(OBJ_DIR)/%.obj:$(SRC_DIR)/%.asm
+       @echo Building: $(subst $$,\$$,$@)
+       @if [ ! -d $(OBJ_DIR) ]; then mkdir $(OBJ_DIR); fi
+       @ rm -f $@
+       @ cd $(OBJ_DIR) && $(ASM_COMMAND) ../$(subst $$,\$$,$^)
+       @ cd $(OBJ_DIR) && ldc -s -l $(notdir $(subst $$,\$$,$@))
 
 clean:
-       @rm -f *.obj $(subst $$,\$$,$(OWN_3) $(foreach obj,$(OWN_2),src/$(obj))) io.lib *.lst
+       @echo Cleaning up.
+       @rm -rf $(OBJ_DIR) $(LIB_DIR)  *.lst *.go 
+       @buildlib.sh clean
+org:
+       ./makeorg.sh
+
+.PHONY: clean all org obj libs
 
-###########
-.PHONY: clean all obj object objects
diff --git a/lib/iolib/buildlib.sh b/lib/iolib/buildlib.sh
new file mode 100755 (executable)
index 0000000..dfb8d27
--- /dev/null
@@ -0,0 +1,87 @@
+#!/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
+#######################################################################
+IFS="
+"
+
+# 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 -l
+    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
+           if ! echo $item | egrep -q " *#"; then
+               echo "appending $item."
+               cat $item >> $lib || (echo "Error! could not find:$item")
+           fi
+        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/iolib/original/io-base.lib b/lib/iolib/original/io-base.lib
new file mode 100644 (file)
index 0000000..187da10
Binary files /dev/null and b/lib/iolib/original/io-base.lib differ
diff --git a/lib/iolib/recipe/io.recipe b/lib/iolib/recipe/io.recipe
new file mode 100644 (file)
index 0000000..39896a1
--- /dev/null
@@ -0,0 +1,13 @@
+# These are the selfmade modules
+obj/O$AL
+obj/O$LA
+obj/O$PB
+obj/O$PL
+obj/I$PA
+
+# And here come the original ones
+org/I$AB
+org/I$AI
+org/O$AB
+#org/O$AH Not needed!
+org/O$AI
index 91b706423890546a44c0cd465279f92363e45268..625764e12f0a60ef9ea53e5957d88ae21c3e88f8 100644 (file)
@@ -11,7 +11,7 @@ ldc: ldc.o process.o hw_helpers.o tape.o split.o
        @gcc -o$@  $^
 
 clean:
-       rm -f *.o ldc
+       rm -f *.o ldc ../../bin/ldc
 
 install: ldc
        cp ldc ../../bin