Worked on the buildlib.sh.
Centralized buildlib.sh to a new lib/common directory.
# Toplevel Makefile for Hachti's H316 stuff collection
# First we need the PC side tools. Nothing runs without them!
-SUBDIRS=pc-tools/ldc pc-tools/src-filters pc-tools/boot-maker
+SUBDIRS=pc-tools
# Now we build the libraries which are always rebuild using the original compiler and
# assembler tapes
# If you want to build the docs, too: Uncomment next line:
#SUBDIRS+=docs/manual
+
default:
@mklink.sh
@$(foreach subdir, $(SUBDIRS), $(MAKE) -C $(subdir)&&) /bin/true
clean:
- rmlink.sh
+ @rmlink.sh
$(foreach subdir, $(SUBDIRS), $(MAKE) -C $(subdir) $@;)
%:
exit 2
fi
-echo "Assembling $1 with original DAP 8K SLST!"
+echo -e "\nAssembler: Translating \"$1\" (Original DAP-16 8K SLST):"
for n in $*; do
if [ $n == "/v" ]; then
rm -f $name.par
rm -f $name.go
fi
- echo "DAP-16 assembly successfull :-)"
+ echo "Assembler: Success."
exit 0
fi
cat $name.lst
-echo -e "\nDAP-16 assembly FAILED!"
+echo -e "Assembler: Failed."
rm -f $name.obj
exit 77
ln -s -f $H316/pc-tools/src-filters/tab $H316/bin
ln -s -f $H316/pc-tools/src-filters/zstrip $H316/bin
-ln -s -f $H316/pc-tools/ldc/ldc $H316/bin
+ln -s -f $H316/pc-tools/ldc2/ldc2 $H316/bin/ldc
ln -s -f $H316/pc-tools/boot-maker/bmaker $H316/bin
ln -s -f $H316/honeywell/lib/iolib35.lib $H316/lib/iolib/original/iolib35.lib
ln -s -f $H316/honeywell/lib/flib{1,2,3}.lib $H316/lib/fortran/original
+
+for nb in `ls $H316/lib/common | grep -v CVS`; do
+ n=`basename "$nb"`
+ ln -s -f "$H316/lib/common/$n" $H316/lib/fortran
+ ln -s -f "$H316/lib/common/$n" $H316/lib/iolib
+done
+
\ No newline at end of file
rm -f $H316/lib/iolib/original/iolib35.lib
rm -f $H316/lib/fortran/original/flib{1,2,3}.lib
+
+for nb in `ls $H316/lib/common | grep -v CVS`; do
+ n=`basename "$nb"`
+ rm -f "$H316/lib/fortran/$n"
+ rm -f "$H316/lib/iolib/$n"
+done
+
--- /dev/null
+#!/bin/bash
+
+if [ ! "$MAKE" ]; then
+ echo "Not run from within Makefile!"
+ exit 4
+fi
+
+
+# The suffix for library files (in and out)
+LIB_SUFFIX=.lib
+#######################################################################
+IFS="
+"
+
+# Clean everything up
+clean() {
+ rm -rf $LIB_DIR $ORG_OBJDIR
+}
+
+# Generate org directory containing the original library objects
+make_org() {
+ if [ ! -d "$ORG_OBJDIR" ]; then
+ echo "Buildlib: Creating directory $ORG_OBJDIR."
+ mkdir $ORG_OBJDIR
+ fi
+ tdir=$PWD
+ cd $ORG_OBJDIR
+ cat $tdir/$ORG_LIBDIR/*$LIB_SUFFIX | ldc -saq
+ cd $tdir
+ touch $ORG_OBJDIR/lastrun
+}
+
+genlib(){
+ if [ ! -d "$LIB_DIR" ]; then
+ echo -n "Creating $LIB_DIR:"
+ mkdir $LIB_DIR && echo "Ok." || echo "FAILED!"
+ fi
+
+ recipe=$1
+ lib=$LIB_DIR/`basename $recipe $RECIPE_SUFFIX`$LIB_SUFFIX
+ echo -e "\nBuildlib: Building library \"$lib\" using recipe \"$1\":"
+ rm -f $lib
+ for item in `cat $recipe| egrep -v '^[[:space:]]*(#.*)*$'`; do
+ iname=`echo $item | egrep -o '[^[:space:]].*[^[:space:]]' |sed 's/.obj$//g'`
+ echo "Buildlib: Appending \"$iname"\"
+ cat $iname >> $lib || (echo "Error! could not find:$item";exit 3)
+ done
+ cat $ENDBLOCK >> $lib
+ echo "Buildlib: Done."
+}
+
+case $1 in
+ clean)
+ clean
+ echo "Buildlib: Cleaning up."
+ ;;
+ makeorg)
+ echo "Buildlib: Splitting original libraries."
+ make_org
+ ;;
+ genlib)
+ genlib $2
+ ;;
+ *)
+ clean
+ make_org
+ genlib
+ ;;
+esac
+
FRTN_COMMAND = frtn_original
ASM_COMMAND = asm_original
-LDC_COMMAND = ldc
+LDC_COMMAND = ldc -saq
#############
all: $(LIBS)
$(ORG_OBJECTS): $(ORG_LIBDIR)/*
- ./buildlib.sh makeorg
+ @./buildlib.sh makeorg
$(OBJECTS): $(OBJECT_FILES)
$(OBJECT_FILES) : $(OBJ_DIR)/%.obj : $(SRC_DIR)/%.asm
- @echo Building: $(subst $$,\$$,$@)
+# @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 $$,\$$,$@))
+ @ cd $(OBJ_DIR) && $(LDC_COMMAND) $(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.
+# @echo Cleaning up.
@rm -rf $(OBJ_DIR) $(LIB_DIR) src/font.asm *.lst *.go
@$(MAKE) -C vpunch-help clean
@./buildlib.sh clean
+++ /dev/null
-#!/bin/bash
-
-if [ ! "$MAKE" ]; then
- echo "Not run from within Makefile!"
- exit 4
-fi
-
-
-# The suffix for library files (in and out)
-LIB_SUFFIX=.lib
-#######################################################################
-IFS="
-"
-
-# Clean everything up
-clean() {
- rm -rf $LIB_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 "$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
- recipe=$1
- lib=$LIB_DIR/`basename $recipe $RECIPE_SUFFIX`$LIB_SUFFIX
- echo "Building $lib:"
- rm -f $lib
- for item in `cat $recipe| egrep -v '^[[:space:]]*(#.*)*$'`; do
- echo "appending $item."
- cat `echo $item| egrep -o '[^[:space:]].*[^[:space:]]'` >> $lib || (echo "Error! could not find:$item")
- done
- cat $ENDBLOCK >> $lib
- #done
-}
-
-
-case $1 in
- clean)
- echo "Clean!"
- clean
- ;;
- makeorg)
- echo "Make org!"
- make_org
- ;;
- genlib)
- echo "Build Lib!"
- genlib $2
- ;;
- *)
- clean
- make_org
- genlib
- ;;
-esac
-
FRTN_COMMAND = frtn_original
ASM_COMMAND = asm_original
-LDC_COMMAND = ldc
+LDC_COMMAND = ldc -saq
#############
LIBS=$(foreach lib,$(basename $(notdir $(RECIPES))),$(LIB_DIR)/$(lib).lib)
-ORG_OBJECTS=$(shell cat $(RECIPES)|egrep -v '^[[:space:]]*(\#.*)*$$'|\
- grep $(ORG_OBJDIR)|sort -u)
+#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)
all: $(LIBS)
-$(ORG_OBJECTS): $(ORG_LIBDIR)/*
- ./buildlib.sh makeorg
+
+$(ORG_OBJDIR)/lastrun: $(ORG_LIBDIR)/*
+ @./buildlib.sh makeorg
+
+#$(ORG_OBJECTS): $(ORG_LIBDIR)/*
+#
+# @echo '$(ORG_OBJECTS)'
$(OBJECTS): $(OBJECT_FILES)
$(OBJECT_FILES) : $(OBJ_DIR)/%.obj : $(SRC_DIR)/%.asm
- @echo Building: $(subst $$,\$$,$@)
+# @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 $$,\$$,$@))
+ @ cd $(OBJ_DIR) && $(LDC_COMMAND) $(notdir $(subst $$,\$$,$@))
-$(LIBS):$(LIB_DIR)/%.lib: $(RECIPE_DIR)/%$(RECIPE_SUFFIX) $(ORG_OBJECTS) $(OBJECTS)
- ./buildlib.sh genlib $(RECIPE_DIR)/$(basename $(notdir $@))$(RECIPE_SUFFIX)
+$(LIBS):$(LIB_DIR)/%.lib: $(RECIPE_DIR)/%$(RECIPE_SUFFIX) $(ORG_OBJDIR)/lastrun $(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
.PHONY: clean all
+.PRECIOUS: org/lastrun
+++ /dev/null
-#!/bin/bash
-
-if [ ! "$MAKE" ]; then
- echo "Not run from within Makefile!"
- exit 4
-fi
-
-
-# The suffix for library files (in and out)
-LIB_SUFFIX=.lib
-#######################################################################
-IFS="
-"
-
-# Clean everything up
-clean() {
- rm -rf $LIB_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 "$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
- recipe=$1
- lib=$LIB_DIR/`basename $recipe $RECIPE_SUFFIX`$LIB_SUFFIX
- echo "Building $lib:"
- rm -f $lib
- 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
-}
-
-
-case $1 in
- clean)
- echo "Clean!"
- clean
- ;;
- makeorg)
- echo "Make org!"
- make_org
- ;;
- genlib)
- echo "Build Lib!"
- genlib $2
- ;;
- *)
- clean
- make_org
- genlib
- ;;
-esac
-
*
* LDC2 source code
*
- * $Date: 2007/03/26 03:20:31 $
+ * $Date: 2007/05/30 02:51:16 $
* $Author: hachti $
*
* $Log: main.cpp,v $
- * Revision 2.2 2007/03/26 03:20:31 hachti
+ * Revision 2.3 2007/05/30 02:51:16 hachti
+ * Changed everything towards LDC2 use.
+ * Worked on the buildlib.sh.
+ * Centralized buildlib.sh to a new lib/common directory.
+ *
+ * Revision 2.2 2007-03-26 03:20:31 hachti
* *** empty log message ***
*
* Revision 2.1 2007-03-26 01:15:21 hachti
// Open file for split objects
if (cfg_split_objects && (block->get_type()!=tape_block::TBT_EOT)){
- if (objname=="UNKNOWN")snprintf(filename,99,"UNKNOWN%02i.obj",
+ if (objname=="UNKNOWN")snprintf(filename,99,"UNKNOWN%02i",
unknown_count);
- else snprintf(filename,99,"%s.obj",objname.c_str());
+ else snprintf(filename,99,"%s",objname.c_str());
if (fd>-1) close (fd);
if (cfg_verbose) fprintf(stdwarn,"Writing file: %s\n",filename);
fd=open(filename,O_WRONLY|O_CREAT|O_TRUNC,0666);
}
// Open file for split objects numbered
- snprintf(filename_numbered,99,"%03i0-%s.obj",obj_no,objname.c_str());
+ snprintf(filename_numbered,99,"%03i0-%s",obj_no,objname.c_str());
if (cfg_split_objects_numbered){
close (fd_numbered);
if (cfg_verbose) fprintf(stdwarn,"Writing file: %s\n",filename_numbered);
*
* LDC2 source code
*
- * $Date: 2007/03/26 01:00:40 $
+ * $Date: 2007/05/30 02:51:16 $
* $Author: hachti $
*
* $Log: tool.hh,v $
- * Revision 2.0 2007/03/26 01:00:40 hachti
+ * Revision 2.1 2007/05/30 02:51:16 hachti
+ * Changed everything towards LDC2 use.
+ * Worked on the buildlib.sh.
+ * Centralized buildlib.sh to a new lib/common directory.
+ *
+ * Revision 2.0 2007-03-26 01:00:40 hachti
* *** empty log message ***
*
*
already_present=true;
break;
}
- if (!already_present) target.insert(target.end(),source[isource]);
+ if (!already_present) target.insert(target.begin(),source[isource]);
}
}