#! /bin/bash

# Public Domain

. cfg.sh

for file in eldcomp ldmem history reclaim instnoun \
	di dm rn rm withhdr printf ifext set variable \
	amount amismsg dx list kdisplay config x dtadisp \
	sotf
do
  "$NASM" -I "$LDEBUG_DIR" -I "$LMACROS_DIR" "$file".asm \
    -w+reloc-rel -w+error=reloc-rel \
    -o "$BIN_DIR$file".eld \
    -l "$LST_DIR$file".lst -D_LISTING="'$file.lst'" "$@" && \
  "$NASM" -I "$LDEBUG_DIR" -I "$LMACROS_DIR" "$file".asm \
    -w+reloc-rel -w+error=reloc-rel \
    -o "$BIN_DIR$file".xld \
    -l "$LST_DIR$file".xls -D_LISTING="'$file.xls'" \
    -D_ELD_DATA_VSTART=0 -D_ELD_CODE_VSTART=0 -D_ELD_RELOC_VSTART=0 \
    -D_ELD_LINKER_PASSES=0 "$@"
done
