I did this for FX30-cat-M in ubuntu16, maybe you can follow:
$> leaf setup fx30-catm -p swi-fx30-catm_3.0.0
$> leaf getsrc legato
$> leaf getsrc swi-linux
$> cd swi-linux
$> make MACH=mdm9x28 PROD=fx30
I did this for FX30-cat-M in ubuntu16, maybe you can follow:
$> leaf setup fx30-catm -p swi-fx30-catm_3.0.0
$> leaf getsrc legato
$> leaf getsrc swi-linux
$> cd swi-linux
$> make MACH=mdm9x28 PROD=fx30