@echo off

SET sdkpath=%xilinxpath%\SDK\%xilinxversion%\bin

SET cfile=%~1
SET jsonfile=%~2
SET projectname=%~3
SET cswfile=%cfile:~3,-2%_sw.c
SET ciffile=%cfile:~3,-2%_if.c

SET toolchainpath=%~4


if not {%~1} == {} if not {%~2} == {} if not {%~3} == {} (

  mkdir software
  copy %ciffile% software
  copy %cswfile% software\helloworld.c
  copy %toolchainpath%\utils\lscript.ld software
  rem copy %toolchainpath%\utils\timer.c software
  rem copy %toolchainpath%\utils\timer.h software
  python %toolchainpath%\python\generatesdktcl.py %cfile% %jsonfile% %projectname% %toolchainpath%
  %sdkpath%\xsdk.bat -batch -source %projectname%_build_sdk.tcl

) else (
    echo "few arguments!"
)

@echo off

SET sdkpath=%xilinxpath%\SDK\%xilinxversion%\bin

SET cfile=%~1
SET jsonfile=%~2
SET projectname=%~3
SET cswfile=%cfile:~3,-2%_sw.c
SET ciffile=%cfile:~3,-2%_if.c

SET toolchainpath=%~4


if not {%~1} == {} if not {%~2} == {} if not {%~3} == {} (

  mkdir software
  copy %ciffile% software
  copy %cswfile% software\helloworld.c
  copy %toolchainpath%\utils\lscript.ld software
  python %toolchainpath%\python\generatesdktcl.py %cfile% %jsonfile% %projectname% %toolchainpath%
  %sdkpath%\xsdk.bat -batch -source %projectname%_build_sdk.tcl

) else (
    echo "few arguments!"
)

Delete copy statements of timer.[ch]
Delete copy statements of timer.[ch]
