From 6e993cc0f338e766964282f1694a8c728c316f64 Mon Sep 17 00:00:00 2001 From: hachti Date: Mon, 1 May 2006 19:13:08 +0000 Subject: [PATCH] *** empty log message *** --- bin/super3_create.do | 21 ------------ lib/iolib/Makefile | 60 +++++++++++++++++++++++++-------- lib/iolib/buildlib.sh | 48 ++++++++++---------------- lib/iolib/recipe/io.recipe | 2 +- systems/Makefile | 28 ++++++++++++++++ systems/build_super3.sh | 69 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 162 insertions(+), 66 deletions(-) delete mode 100644 bin/super3_create.do create mode 100644 systems/Makefile create mode 100755 systems/build_super3.sh diff --git a/bin/super3_create.do b/bin/super3_create.do deleted file mode 100644 index 10f2723..0000000 --- a/bin/super3_create.do +++ /dev/null @@ -1,21 +0,0 @@ -rest ../../../sys/super2.sys -d 37000-37777 0 -d 31000-31777 0 -d 35000 37777 -at ptr binal.obj -d a 37000 -go -go -run 36002 -at ptr cleanup2.obj -d a 31000 -go 36000 -go -run 36002 -at ptp super3.slst -run 37000 -d a 31000 -go -d a 37577 -go - diff --git a/lib/iolib/Makefile b/lib/iolib/Makefile index f9c6846..9b36caa 100644 --- a/lib/iolib/Makefile +++ b/lib/iolib/Makefile @@ -1,8 +1,15 @@ # Skript, das die neue Bibliothek zusammenbauen soll (01.01.06) -SRC_DIR = src -OBJ_DIR = obj -LIB_DIR = lib +export SRC_DIR = src +export OBJ_DIR = obj +export LIB_DIR = lib +export RECIPE_DIR = recipe +export RECIPE_SUFFIX=.recipe +export ENDBLOCK=$(H316)/snippets/endseq +export ORG_LIBDIR=original +export ORG_OBJDIR=org + +export MAKE MODULES = o$$al o$$la o$$pl o$$pb i$$pa @@ -10,30 +17,55 @@ FRTN_COMMAND = frtn ASM_COMMAND = asm LDC_COMMAND = ldc -SRC_FILES = $(foreach obj, $(MODULES),$(obj).asm) -OBJ_FILES = $(SRC_FILES:.asm=.obj) -OBJ_FILES_FULL = $(foreach file, $(OBJ_FILES),$(OBJ_DIR)/$(file)) +############# + +#SRC_FILES = $(foreach obj, $(MODULES),$(obj).asm) +#OBJ_FILES = $(SRC_FILES:.asm=.obj) +#OBJ_FILES_FULL = $(foreach file, $(OBJ_FILES),$(OBJ_DIR)/$(file)) + ########################################## -libs : $(OBJ_FILES_FULL) - buildlib.sh -obj : $(OBJ_FILES_FULL) +RECIPES=$(foreach recipe,$(shell ls $(RECIPE_DIR) | grep -v CVS),\ + $(RECIPE_DIR)/$(recipe)) + +LIBS=$(foreach lib,$(basename $(notdir $(RECIPES))),$(LIB_DIR)/$(lib).lib) + +ORG_OBJECTS=$(shell cat $(RECIPES)|egrep -v '^[[:space:]]*(\#.*)*$$'|\ + grep $(ORG_OBJDIR)|sort -u) + +OBJECTS=$(shell cat $(RECIPES)|egrep -v '^[[:space:]]*(\#.*)*$$'|\ + grep $(OBJ_DIR)|sort -u) + +OBJECT_FILES=$(foreach obj, $(MODULES), $(OBJ_DIR)/$(obj).obj) +SOURCE_FILES=$(foreach obj, $(MODULES), $(SRC_DIR)/$(obj).asm) -$(OBJ_FILES_FULL):$(OBJ_DIR)/%.obj:$(SRC_DIR)/%.asm - @echo Building: $(subst $$,\$$,$@) +#************ + +all: $(LIBS) + +$(ORG_OBJECTS): $(ORG_LIBDIR)/* + ./buildlib.sh makeorg + +$(OBJECTS): $(OBJECT_FILES) + +$(OBJECT_FILES) : $(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 $$,\$$,$@)) +$(LIBS):$(LIB_DIR)/%.lib: $(RECIPE_DIR)/%$(RECIPE_SUFFIX) $(ORG_OBJECTS) $(OBJECTS) + buildlib.sh genlib $(RECIPE_DIR)/$(basename $(notdir $@))$(RECIPE_SUFFIX) + + clean: @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 + diff --git a/lib/iolib/buildlib.sh b/lib/iolib/buildlib.sh index dfb8d27..5362d52 100755 --- a/lib/iolib/buildlib.sh +++ b/lib/iolib/buildlib.sh @@ -1,22 +1,13 @@ #!/bin/bash -# Here we find the recipes for the libraries. -RECIPE_DIR=recipe +if [ ! "$MAKE" ]; then + echo "Not run from within Makefile!" + exit 4 +fi -# 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 @@ -26,7 +17,7 @@ IFS=" # Clean everything up clean() { - rm -rf $OUTPUT_DIR $ORG_OBJDIR + rm -rf $LIB_DIR $ORG_OBJDIR } # Generate org directory containing the original library objects @@ -42,26 +33,23 @@ make_org() { genlib(){ echo "Library Builder start." - if [ ! -d "$OUTPUT_DIR" ]; then - echo -n "Creating $OUTPUT_DIR:" - mkdir $OUTPUT_DIR && echo "Ok." || echo "FAILED!" + if [ ! -d "$LIB_DIR" ]; then + echo -n "Creating $LIB_DIR:" + mkdir $LIB_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 + # RECIPE_LIST=`ls $RECIPE_DIR/*$RECIPE_SUFFIX` + # for recipe in $RECIPE_LIST; do + recipe=$1 + lib=$LIB_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 + for item in `cat $recipe| egrep -v '^[[:space:]]*(#.*)*$'`; do + echo "appending $item." + cat $item >> $lib || (echo "Error! could not find:$item") done cat $ENDBLOCK >> $lib - done + #done } @@ -74,9 +62,9 @@ case $1 in echo "Make org!" make_org ;; - lib) + genlib) echo "Build Lib!" - genlib + genlib $2 ;; *) clean diff --git a/lib/iolib/recipe/io.recipe b/lib/iolib/recipe/io.recipe index 91fc1de..fb849fe 100644 --- a/lib/iolib/recipe/io.recipe +++ b/lib/iolib/recipe/io.recipe @@ -16,7 +16,7 @@ obj/O$LA obj/I$PA # And here come the original ones - + org/I$AB org/I$AI org/O$AB diff --git a/systems/Makefile b/systems/Makefile new file mode 100644 index 0000000..e8a08b0 --- /dev/null +++ b/systems/Makefile @@ -0,0 +1,28 @@ +# Makefile for system generation + +# Targets +export SUPER3_SYS=$(H316)/sys/super3.sys +export SUPER3_SLST=$(H316)/slst/super3.slst + +# Used files +export LDR_APM_8K=$(H316)/slst/ldr-apm_8k.slst +export LDR_APM=$(H316)/obj/ldr-apm.obj +export LDR_DUMY=$(H316)/obj/ldr-dumy.obj +export PRNTNZ=$(H316)/obj/prntnz.obj +export CLEANUP=$(H316)/programs/tools/build/cleanup2.obj +export BINAL=$(H316)/programs/tools/build/binal.obj + +export MAKE + +all: super3 + +super3: $(SUPER3_SLST) + +$(SUPER3_SLST): $(LDR_APM_8K) $(LDR_APM) $(LDR_DUMY) $(PRNTNZ)\ + $(CLEANUP) $(BINAL) + ./build_super3.sh + +clean: + rm -f $(SUPER3_SLST) $(SUPER3_SYS) + +.PHONY: super3 \ No newline at end of file diff --git a/systems/build_super3.sh b/systems/build_super3.sh new file mode 100755 index 0000000..88e51e8 --- /dev/null +++ b/systems/build_super3.sh @@ -0,0 +1,69 @@ +#!/bin/sh + +DO_FILE=s3.do + +if [ ! "$MAKE" ]; then + echo "Not run from within Makefile!" + exit 4 +fi + +cat > $DO_FILE <