#!/bin/sh

if [ $# != 1 ]
then
	echo "usage: $0 target" 1>&2
	exit 1
fi

if [ ! -f "targets/$1.h" -o ! -f "targets/$1.inc" ]
then
	echo "Error: target $1 not known" 1>&2
	exit 1
fi

. "targets/$1.inc"

set -e

gsmlong=gsm_ac_gp_fd_pu_em_cph_ds_vc_cal35_ri_36_amd8_ts0

(cd __out__/$gsmlong/lib; ln -sf "main-$MAIN_variant.lib" main.lib)

mkdir -p __out__/$gsmlong/config

(cd __out__/$gsmlong/config; ln -sf "../../../targets/$1.h" fc-target.cfg)
