#!/bin/sh
dst=$1
shift
project=${dst#${TEVWH_OUT}/}
project=${project%/*}

${TEVWH_PATH_CC} ${TEVWH_CFLAGS} -c \
	./src/${project}/${TEVWH_ARCH}-${TEVWH_UNAME}.S \
	-o ${TEVWH_TMP}/${project}/infection \
&& ${TEVWH_PATH_OBJDUMP} -d ${TEVWH_TMP}/${project}/infection \
| ${TEVWH_PATH_SED} -ne '/^[[:space:]]*[[:xdigit:]]\{1,\}:/ p' \
| ./src/platform/disasm.pl \
	"-identfier=infection" \
	"-last_line_is_ofs=" \
	"$@" \
	> ${dst}
