#!/usr/bin/env bash set -euo pipefail cd "$(dirname "$0")/.." cache=${MARS_TOOLCHAIN_DIR:-$PWD/.toolchains} if [[ -z ${WATCOM:-} ]]; then if [[ ! -f $cache/watcom/ROOT ]]; then [[ ${MARS_OFFLINE:-0} != 1 ]] || { echo "No cached Open Watcom; run make windows-tools" >&2; exit 1; } ./cross/fetch-watcom.sh fi WATCOM=$(realpath "$cache/watcom/$(cat "$cache/watcom/ROOT")") fi export WATCOM PATH="$WATCOM/binl64:$WATCOM/binl:$PATH" INCLUDE="$WATCOM/h:$WATCOM/h/nt" mkdir -p build/cross/watcom # Compile actual shared IPXPKT sources as 32-bit Windows objects, not a driver. wcc386 -q -bt=nt -3 -i=src -fo=build/cross/watcom/ipxpkt.obj src/ipxpkt.c wcc386 -q -bt=nt -3 -i=src -i=clients/windows -fo=build/cross/watcom/client_core.obj clients/windows/client_core.c echo 'Watcom protocol objects built; not an installable adapter.'