Skip to content

Commit

Permalink
Updating_all_sample_codes_C++
Browse files Browse the repository at this point in the history
These are the sample codes for C++ given in the pendrive which comes with the AWG manual.
  • Loading branch information
phataks committed Oct 6, 2021
1 parent 5ad6f07 commit fa43e0f
Show file tree
Hide file tree
Showing 396 changed files with 73,069 additions and 0 deletions.
81 changes: 81 additions & 0 deletions AWG_sample_codes_C++/c_cpp/build_all_examples.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
@echo off

rem This script checks all subdirectories for .vcproj files and tries to build
rem each project as 32bit and 64bit application, both debug and release.

setlocal EnableDelayedExpansion

set LIST=

rem Konvertierung vcproj -> vcxproj:
rem devenv /Upgrade xyz.vcproj
rem danach gibt es Linkerfehler, weil die Libs falsch eingebunden sind.
rem dagegen hilft sed:
rem sed -i "s/CustomBuild/Library/" %%P
rem danach sind noch die Ausgabepfade Murks
rem wieder sed:
rem sed -i "/<Link>/{n;s/.*/ <OutputFile>$(TargetPath)<\/OutputFile>/ }" %%P

rem ältere msbuild Versionen geben komische Fehler
set MSBUILD="C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe"

rem loop over all directories
FOR /F %%D in ('dir /A:D /B') DO (
pushd %%D

rem loop over all .vcproj files in directory
FOR /F %%P in ('dir /B *.vcxproj 2^>nul') DO (
rem vcbuild /r /platform:Win32 %%P Debug
rem
%MSBUILD% /target:Rebuild /property:Configuration=Debug;Platform=x86 %%P
if ERRORLEVEL 1 (
echo.
echo ERROR: %%D/%%P Win32 Debug FAILED
set LIST=!LIST! "%%D/%%P Win32 Debug"
)
rem vcbuild /r /platform:Win32 %%P Release
rem sed -i "s/CustomBuild/Library/" %%P
rem sed -i "/<Link>/{n;s/.*/ <OutputFile>$(TargetPath)<\/OutputFile>/ }" %%P
%MSBUILD% /target:Rebuild /property:Configuration=Release;Platform=x86 %%P
if ERRORLEVEL 1 (
echo.
echo ERROR: %%D/%%P Win32 Release FAILED
set LIST=!LIST! "%%D/%%P Win32 Release"
)
rem vcbuild /r /platform:x64 %%P Debug
rem sed -i "s/CustomBuild/Library/" %%P
rem sed -i "/<Link>/{n;s/.*/ <OutputFile>$(TargetPath)<\/OutputFile>/ }" %%P
%MSBUILD% /target:Rebuild /property:Configuration=Debug;Platform=x64 %%P
if ERRORLEVEL 1 (
echo.
echo ERROR: %%D/%%P x64 Debug FAILED
set LIST=!LIST! "%%D/%%P x64 Debug"
)
rem vcbuild /r /platform:x64 %%P Release
rem sed -i "s/CustomBuild/Library/" %%P
rem sed -i "/<Link>/{n;s/.*/ <OutputFile>$(TargetPath)<\/OutputFile>/ }" %%P
%MSBUILD% /target:Rebuild /property:Configuration=Release;Platform=x64 %%P
if ERRORLEVEL 1 (
echo.
echo ERROR: %%D/%%P x64 Release FAILED
set LIST=!LIST! "%%D/%%P x64 Release"
)
)

popd
)

echo.
echo *****************************************
IF DEFINED LIST (
echo The following examples failed to compile:
echo.
FOR %%a in (%LIST%) DO echo %%a
echo.
exit /B 1
) ELSE (
echo All examples compiled successfully
echo.
exit /B 0
)

38 changes: 38 additions & 0 deletions AWG_sample_codes_C++/c_cpp/build_all_examples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/sh

LIST_OF_FAILED=()

# ***** compile + error check *****
compile_and_check() # (path, makefile-name)
{
echo
echo
echo "***** Compiling `pwd $1`/"$1
make -f $1 clean
if [ $? != 0 ]; then
LIST_OF_FAILED[${#LIST_OF_FAILED[*]}]="$(pwd $1)/$1"
return 1
fi
make -f $1
if [ $? != 0 ]; then
LIST_OF_FAILED[${#LIST_OF_FAILED[*]}]="$(pwd $1)/$1"
return 1
fi
make -f $1 clean
return $?
}

# check C++ examples
for i in `find . -type d -not -iwholename '*.svn*' -not -iwholename '*cuda*'`; do
pushd $i
for j in `ls makefile*`; do
compile_and_check $j
done
popd
done

echo
echo ********************************************************************************
echo Failed Builds:

echo $LIST_OF_FAILED
Binary file added AWG_sample_codes_C++/c_cpp/c_header/SpcStdNT.lib
Binary file not shown.

0 comments on commit fa43e0f

Please sign in to comment.