From 6c33b62da23688ad28889758bc7d919110cd2e42 Mon Sep 17 00:00:00 2001 From: hachti Date: Mon, 2 Jan 2006 21:33:31 +0000 Subject: [PATCH] *** empty log message *** --- {lib/fortran => bin}/mkrecipe.sh | 0 lib/fortran/Makefile | 3 -- lib/iolib/Makefile | 55 +++++++++---------- lib/iolib/buildlib.sh | 87 +++++++++++++++++++++++++++++++ lib/iolib/original/io-base.lib | Bin 0 -> 4251 bytes lib/iolib/recipe/io.recipe | 13 +++++ pc-tools/ldc/Makefile | 2 +- 7 files changed, 129 insertions(+), 31 deletions(-) rename {lib/fortran => bin}/mkrecipe.sh (100%) create mode 100755 lib/iolib/buildlib.sh create mode 100644 lib/iolib/original/io-base.lib create mode 100644 lib/iolib/recipe/io.recipe diff --git a/lib/fortran/mkrecipe.sh b/bin/mkrecipe.sh similarity index 100% rename from lib/fortran/mkrecipe.sh rename to bin/mkrecipe.sh 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/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 0000000000000000000000000000000000000000..187da1035e0481c6ab0ce773ddc9dc422423cab3 GIT binary patch literal 4251 zcma)<4R72=4u&~1!b*Zh9|*i@+VwSmbY;mO$hq*QHFCMc$OhS8+Uz~=Nb+ve_EG`1 zsS$_6A>WszuZ`!<;+wme``(X}5Z{a|v;Q2g?ZPaYy-IRs)=8a3eY)5Bvwr-z(jq$V zlMcTI$D6ZI#=9kx#K?|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