From: hachti Date: Mon, 2 Jan 2006 21:33:31 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://gitweb.hachti.de/?a=commitdiff_plain;h=6c33b62da23688ad28889758bc7d919110cd2e42;p=h316.git *** empty log message *** --- diff --git a/bin/mkrecipe.sh b/bin/mkrecipe.sh new file mode 100755 index 0000000..8b24918 --- /dev/null +++ b/bin/mkrecipe.sh @@ -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/Makefile b/lib/fortran/Makefile index 1513de4..2862bf9 100644 --- a/lib/fortran/Makefile +++ b/lib/fortran/Makefile @@ -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 index 8b24918..0000000 --- a/lib/fortran/mkrecipe.sh +++ /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 diff --git a/lib/iolib/Makefile b/lib/iolib/Makefile index ae59566..f9c6846 100644 --- a/lib/iolib/Makefile +++ b/lib/iolib/Makefile @@ -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 index 0000000..dfb8d27 --- /dev/null +++ b/lib/iolib/buildlib.sh @@ -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 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 index 0000000..39896a1 --- /dev/null +++ b/lib/iolib/recipe/io.recipe @@ -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 diff --git a/pc-tools/ldc/Makefile b/pc-tools/ldc/Makefile index 91b7064..625764e 100644 --- a/pc-tools/ldc/Makefile +++ b/pc-tools/ldc/Makefile @@ -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