Forum Discussion
Altera_Forum
Honored Contributor
9 years agoI do the following:
I put all commands in a shell script, then I execute a wrapper bat file. alt_win.cmd
@echo off
mode con lines=32766
setlocal enabledelayedexpansion
SET myPwd=%CD%
:: 64-bit / 32-bit OS detection
SET binName=bin
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" SET binName=bin64
if "%QUARTUS_ROOTDIR%"=="" echo Env Var QUARTUS_ROOTDIR is missing. Is Quatrus installed? Is the path set correctly & exit /b 1
SET QUARTUS_BINDIR=%QUARTUS_ROOTDIR%\%binName%
SET PATH=%PATH%;%QUARTUS_BINDIR%
for /f "delims=" %%a in ('%SOPC_KIT_NIOS2%\bin\cygpath\cygpath.exe %myPwd%') do @set myCygPwd=%%a
::echo %myCygPwd%
%SOPC_KIT_NIOS2%\"Nios II Command Shell.bat" %myCygPwd%/%*
example.bat
@echo off
alt_win.cmd %~n0.sh %*
example.sh
# !/usr/bin/env bash
--SNIP--
cmd="quartus_pgm -c $uCable -m jtag -o ipv;$binDir/$flashFile"
echo " Running \"$cmd\""
$cmd || {
echo -e "\e quartus_pgm failed. \e[0m"
exitFunc 1
}
--SNIP
Using this methods allows you to have a unified interface to Windows and GNU/Linux. Windows users will double click on the example.bat file or even run it from cmd (with parameters and all) and GNU/Linux users will run the example.sh shell script as usual. Here is a working example : https://bitbucket.org/ftabunimeh/supportboard/src/default/scripts/