#!/bin/bash

touch compiling.lock

if [ ! -x dimctrl ]; then
   make $* dimctrl || exit
fi

dimctrl --quit --cmd ".w 3000" --cmd "DIS_DNS/KILL_SERVERS" --cmd ".w 3000" --cmd "DIS_DNS/EXIT 100"

sleep 5

make clean

make $* && rm compiling.lock
