+++ /dev/null
-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
-
# 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
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
+
#!/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
# Clean everything up
clean() {
- rm -rf $OUTPUT_DIR $ORG_OBJDIR
+ rm -rf $LIB_DIR $ORG_OBJDIR
}
# Generate org directory containing the original library objects
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
}
echo "Make org!"
make_org
;;
- lib)
+ genlib)
echo "Build Lib!"
- genlib
+ genlib $2
;;
*)
clean
obj/I$PA
# And here come the original ones
-
+
org/I$AB
org/I$AI
org/O$AB
--- /dev/null
+# 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
--- /dev/null
+#!/bin/sh
+
+DO_FILE=s3.do
+
+if [ ! "$MAKE" ]; then
+ echo "Not run from within Makefile!"
+ exit 4
+fi
+
+cat > $DO_FILE <<EOF
+echo Booting $LDR_APM_8K
+at ptr $LDR_APM_8K
+boot ptr
+echo Loading $LDR_APM
+; enter high loader address for loading above itself
+d 15000 37777
+at ptr $LDR_APM
+; load location
+d a 33000
+d p 16000
+go
+go
+at ptr $LDR_DUMY
+go
+echo loading $PRNTNZ
+at ptr $PRNTNZ
+d a 32000
+d p 16000
+go
+go
+echo loading $CLEANUP
+at ptr $CLEANUP
+d a 31000
+d p 16000
+go
+go
+echo Loading $BINAL
+at ptr $BINAL
+d a 37000
+d p 16000
+go
+go
+
+;d a 0
+;d b 37777
+;go 32000
+
+; Clear memory
+d 100-17777 0
+
+; Settings for immediate load after sys restore
+r
+d p 36000
+
+save $SUPER3_SYS
+
+at ptp $SUPER3_SLST
+d a 0
+go 37000
+d a 31000
+go
+d a 37577
+go
+echo Complete.
+q
+EOF
+h316 $DO_FILE
+rm -f $DO_FILE
+echo dd $FF