Skip to content

Commit d1f5cea

Browse files
committed
updated .md files, updated build scripts
1 parent 0cf3a7b commit d1f5cea

File tree

25 files changed

+267
-112
lines changed

25 files changed

+267
-112
lines changed

README.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
<tr>
55
<td style="border:0;padding:0 10px 0 0;min-width:25%;"><a href="https://isocpp.org/" rel="external"><img src="docs/images/cpp_logo.png" width="100" alt="ISO C++ project"/></a></td>
66
<td style="border:0;padding:0;vertical-align:text-top;">This repository gathers <a href="https://isocpp.org/" rel="external" title="ISO C++">C++</a> code examples coming from various websites and books.<br/>
7-
It also includes build scripts (<a href="https://en.wikibooks.org/wiki/Windows_Batch_Scripting" rel="external">batch files</a>, <a href="https://makefiletutorial.com/" rel="external">Make scripts</a>) for experimenting with <a href="https://isocpp.org/" rel="external">ISO C++</a> on a Windows machine.
8-
</td>
7+
It also includes build scripts (<a href="https://en.wikibooks.org/wiki/Windows_Batch_Scripting" rel="external">batch files</a>, <a href="https://makefiletutorial.com/" rel="external">Make scripts</a>) for experimenting with <a href="https://isocpp.org/" rel="external">ISO C++</a> on a Windows machine.</td>
98
</tr>
109
</table>
1110

12-
[Ada][ada_examples], [Akka][akka_examples], [COBOL][cobol_examples], [Dart][dart_examples], [Deno][deno_examples], [Docker][docker_examples], [Erlang][erlang_examples], [Flix][flix_examples], [Golang][golang_examples], [GraalVM][graalvm_examples], [Haskell][haskell_examples], [Kafka][kafka_examples], [Kotlin][kotlin_examples], [LLVM][llvm_examples], [Modula-2][m2_examples], [Node.js][nodejs_examples], [Rust][rust_examples], [Scala 3][scala3_examples], [Spark][spark_examples], [Spring][spring_examples], [TruffleSqueak][trufflesqueak_examples] and [WiX Toolset][wix_examples] are other topics we are continuously investigating.
11+
[Ada][ada_examples], [Akka][akka_examples], [COBOL][cobol_examples], [Dart][dart_examples], [Deno][deno_examples], [Docker][docker_examples], [Erlang][erlang_examples], [Flix][flix_examples], [Golang][golang_examples], [GraalVM][graalvm_examples], [Haskell][haskell_examples], [Kafka][kafka_examples], [Kotlin][kotlin_examples], [LLVM][llvm_examples], [Modula-2][m2_examples], [Node.js][nodejs_examples], [Rust][rust_examples], [Scala 3][scala3_examples], [Spark][spark_examples], [Spring][spring_examples], [TruffleSqueak][trufflesqueak_examples], [WiX Toolset][wix_examples] and [Zig][zig_examples] are other topics we are continuously investigating.
12+
13+
> **&#9755;** Read the document <a href="https://www.geeksforgeeks.org/history-of-c/" rel="external">"History of C++"</a> to get a quick overview of the evolution of C++.
1314
1415
## <span id="proj_deps">Project dependencies</span>
1516

@@ -29,7 +30,7 @@ Optionally one may also install the following software:
2930
-->
3031
- [Bazel 7.2 LTS][bazel_downloads] ([*release notes*][bazel_relnotes])
3132
- [ConEmu][conemu_downloads] ([*release notes*][conemu_relnotes])
32-
- [Doxygen 1.10][doxygen_downloads] ([*changelog*][doxygen_changelog])
33+
- [Doxygen 1.11][doxygen_downloads] ([*changelog*][doxygen_changelog])
3334
- [Embarcadero C++ 7.30 Compiler][bcc_downloads]
3435
- [OrangeC 6.73][orangec_downloads] ([*release notes*][orangec_relnotes])
3536
- [Visual Studio Code 1.89][vscode_downloads] ([*release notes*][vscode_relnotes])
@@ -110,7 +111,7 @@ We execute command [**`setenv`**](setenv.bat) once to setup our development envi
110111
<b>&gt; <a href="setenv.bat">setenv</a></b>
111112
Tool versions:
112113
bazel 7.1.2, bcc32c 7.30, clang 17.0.6, gcc 13.2.0, icx 2024.0.2, occ 6.73.8
113-
cmake 3.29.3, cl 19.36.32532, cppcheck 2.13.0, doxygen 1.10.0, msbuild 17.7.2.37605
114+
cmake 3.29.3, cl 19.36.33523, cppcheck 2.14.1, doxygen 1.11.0, msbuild 17.9.8.16306
114115
git 2.45.2, diff 3.10, bash 5.2.26(1)-release
115116

116117
<b>&gt; <a href="https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/where_1" rel="external">where</a> bazel git sh</b>
@@ -347,4 +348,5 @@ Concretely, in our GitHub projects which depend on Visual Studio (e.g. <a href="
347348
[winsdk_downloads]: https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/
348349
[winsdk_relnotes]: https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/#relnote
349350
[wix_examples]: https://github.com/michelou/wix-examples#top
351+
[zig_examples]: https://github.com/michelou/zig-examples#top
350352
[zip_archive]: https://www.howtogeek.com/178146/htg-explains-everything-you-need-to-know-about-zipped-files/

concurrency-examples/README.md

+22-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# <span id="top">Book <i>Concurrency with Modern C++</i></span> <span style="size:30%;"><a href="../README.md">⬆</a></span>
1+
# <span id="top">Book <i>Concurrency with Modern C++</i></span> <span style="font-size:90%;">[](../README.md#top)</span>
22

33
<table style="font-family:Helvetica,Arial;line-height:1.6;">
44
<tr>
@@ -14,7 +14,22 @@
1414

1515
## <span id="acquireConsume">`acquireConsume` Example</span>
1616

17-
This example consists of source file [`acquireConsume.cpp`](./acquireConsume/src/main/cpp/acquireConsume.cpp) and build script [`build.bat`](./acquireConsume/build.bat) (with options `-bcc`, `-clang`, `-gcc`, `-icx` and `-msvc`).
17+
This example has the following directory structure :4
18+
19+
<pre style="font-size:80%;">
20+
<b>&gt; <a href="https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/tree">tree</a> /a /f . | <a href="https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/findstr">findstr</a> /v /b [A-Z]</a>
21+
| <a href="./acquireConsume/build.bat">build.bat</a>
22+
| <a href="./acquireConsume/build.sh">build.sh</a></a>
23+
| <a href="./acquireConsume/CMakeLists.txt">CMakeLists.txt
24+
| <a href="./acquireConsume/Doxyfile">Doxyfile</a>
25+
| <a href="./acquireConsume/Makefile">Makefile</a>
26+
\---src
27+
\---main
28+
\---cpp
29+
<a href="./acquireConsume/src/main/cpp/acquireConsume.cpp">acquireConsume.cpp</a>
30+
</pre>
31+
32+
Command [`build.bat`](./acquireConsume/build.bat)`run` generates and executes the C++ program `target\acquireConsume.exe` (with options `-bcc`, `-clang`, `-gcc`, `-icx` and `-msvc` to specify a compiler).
1833

1934
<pre style="font-size:80%;">
2035
<b>&gt; <a href="./acquireConsume/build.bat">build</a> -verbose -gcc run</b>
@@ -26,7 +41,11 @@ Execute "build\acquireConsume.exe"
2641
*p2: C++11
2742
data: 2011
2843
atoData: 2014
29-
&nbsp;
44+
</pre>
45+
46+
One may also run command [`make`](https://linux.die.net/man/1/make)`run` :
47+
48+
<pre style="font-size:80%;">
3049
<b>&gt; <a href="https://linux.die.net/man/1/make">make</a> clean run</b>
3150
"C:/opt/msys64/usr/bin/rm.exe" -rf "build"
3251
"C:/opt/msys64/mingw64/bin/g++.exe" --std=c++17 -O2 -Wall -Wno-unused-variable -o build/Release/acquireConsume.exe src/main/cpp/acquireConsume.cpp

examples/Makefile.inc

+9-8
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,20 @@ BCC = $(subst \,/,$(BCC_HOME))/bin/bcc32c.exe
4949
CC = $(subst \,/,$(MSYS_HOME))/usr/bin/g++.exe
5050
CL = $(subst \,/,$(MSVC_HOME))/bin/Host$(ARCH)/$(ARCH)/cl.exe
5151
CLANG = $(subst \,/,$(LLVM_HOME))/bin/clang.exe
52-
CP = $(subst \,/,$(MSYS_HOME))/usr/bin/cp.exe
53-
CPPCHECK = $(subst \,/,$(MSYS_HOME))/mingw64/bin/cppcheck.exe
5452
DOXYGEN = $(subst \,/,$(DOXYGEN_HOME))/doxygen.exe
55-
ECHO = $(subst \,/,$(MSYS_HOME))/usr/bin/echo.exe
56-
FIND = $(subst \,/,$(MSYS_HOME))/usr/bin/find.exe
5753
ICX = $(subst \,/,$(ONEAPI_ROOT))/compiler/latest/bin/icx.exe
5854
LLC = $(subst \,/,$(LLVM_HOME))/bin/llc.exe
5955
LLVM_CONFIG = $(subst \,/,$(LLVM_HOME))/bin/llvm-config.exe
60-
MKDIR = $(subst \,/,$(MSYS_HOME))/usr/bin/mkdir.exe
6156
OCC = $(subst \,/,$(ORANGEC_HOME))/bin/occ.exe
62-
RM = $(subst \,/,$(MSYS_HOME))/usr/bin/rm.exe
63-
TEST = $(subst \,/,$(MSYS_HOME))/usr/bin/test.exe
64-
TOUCH = $(subst \,/,$(MSYS_HOME))/usr/bin/touch.exe
57+
## $(MSYS_HOME)\usr\bin\{cp.exe, make.exe, wget.exe}
58+
CP = /usr/bin/cp.exe
59+
CPPCHECK = /mingw64/bin/cppcheck.exe
60+
ECHO = /usr/bin/echo.exe
61+
FIND = /usr/bin/find.exe
62+
MKDIR = /usr/bin/mkdir.exe
63+
RM = /usr/bin/rm.exe
64+
TEST = /usr/bin/test.exe
65+
TOUCH = /usr/bin/touch.exe
6566
#
6667
MSVC_INCPATH = $(subst \,/,$(MSVC_HOME))/include
6768
MSVC_LIBPATH = $(subst \,/,$(MSVC_HOME))/lib/$(ARCH)

examples/README.md

+20-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
# <span id="top">C++ Examples</span> <span style="size:30%;"><a href="../README.md">⬆</a></span>
1+
# <span id="top">C++ Examples</span> <span style="font-size:90%;">[](../README.md#top)</span>
22

33
<table style="font-family:Helvetica,Arial;line-height:1.6;">
44
<tr>
55
<td style="border:0;padding:0 10px 0 0;min-width:25%;"><a href="https://isocpp.org/" rel="external"><img src="../docs/images/cpp_logo.png" width="100" alt="C++ project"/></a></td>
66
<td style="border:0;padding:0;vertical-align:text-top;">Directory <a href="."><strong><code>examples\</code></strong></a> contains <a href="https://isocpp.org/" rel="external" title="ISO C++">ISO C++</a> code examples coming from various websites - mostly from the <a href="https://isocpp.org/" rel="external" title="ISO C++">C++</a> project.<br/>
7-
It also includes build scripts (<a href="https://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html" rel="external">Bash scripts</a>, <a href="https://en.wikibooks.org/wiki/Windows_Batch_Scripting" rel="external">batch files</a>, <a href="https://makefiletutorial.com/" rel="external">Make scripts</a>) for experimenting with <a href="https://isocpp.org/" rel="external">C++</a> on a Windows machine.
8-
</td>
7+
It also includes build scripts (<a href="https://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html" rel="external">Bash scripts</a>, <a href="https://en.wikibooks.org/wiki/Windows_Batch_Scripting" rel="external">batch files</a>, <a href="https://makefiletutorial.com/" rel="external">Make scripts</a>) for experimenting with <a href="https://isocpp.org/" rel="external">C++</a> on a Windows machine.</td>
98
</tr>
109
</table>
1110

@@ -22,7 +21,24 @@ The code examples presented below can be built/run with the following command li
2221

2322
## <span id="hello">`hello` Example</span>
2423

25-
This example consists of one source file [`src\main.cpp`](./hello/src/main.cpp).
24+
This example has the following directory structure :
25+
26+
<pre style="font-size:80%;">
27+
<b>&gt; <a href="https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/tree" rel="external">tree</a> /a /f . | <a href="https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/finsdtr" rel="external">findstr</a> /v /b [A-Z]</b>
28+
| <a href="./hello/build.bat">build.bat</a>
29+
| <a href="./hello//build.sh">build.sh</a>
30+
| <a href="./hello/CMakeLists.txt">CMakeLists.txt</a>
31+
| <a href="./hello/Doxyfile">Doxyfile</a>
32+
| <a href="./hello/Makefile">Makefile</a>
33+
\---src
34+
| <a href="./hello/src/BUILD.bazel">BUILD.bazel</a>
35+
\---main
36+
+---cpp
37+
| <a href="./hello/src/main.cpp">main.cpp</a>
38+
\---resources
39+
<a href="./hello/src/main/resources/hello.png">hello.png</a>
40+
<a href="./hello/src/main/resources/hello.txt">hello.txt</a>
41+
</pre>
2642

2743
Batch file [**`build.bat`**](./hello/build.bat) generates the `hello.exe` executable using one of the options [`-bcc`][bcc_cli], [`-clang`][clang_cli], [`-gcc`][gcc_cli], [`-icx`][icx_cli], <span style="white-space: nowrap;">[`-msvc`][cl_cli]</span> (default) or [`occ`][occ_cli] :
2844

examples/call-by-copy/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ help:
9494
@$(ECHO) " all alias for build"
9595
@$(ECHO) " build compile C++ source files"
9696
@$(ECHO) " clean delete generated files"
97-
@$(ECHO) " doc generate HTML documentation with Doxygen"
97+
@$(ECHO) " doc generate HTML documentation with Doxygen"
9898
@$(ECHO) " help print this help message"
9999
@$(ECHO) " lint analyze C++ source files with CppCheck"
100100
@$(ECHO) " run execute main program \"$(TARGET)\""
@@ -124,4 +124,4 @@ doc:
124124
.PHONY: all build clean doc help lint run
125125

126126
.SUFFIXES:
127-
.SUFFIXES: .c .cpp .o .obj .exe
127+
.SUFFIXES: .c .cpp .h .hpp .o .obj .exe
Binary file not shown.

examples/call-by-copy/src/main/resources/hello.txt

-1
This file was deleted.

examples/crash_course/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,4 @@ doc:
124124
.PHONY: all build clean doc help lint run
125125

126126
.SUFFIXES:
127-
.SUFFIXES: .c .cpp .o .obj .exe
127+
.SUFFIXES: .c .cpp .h .hpp .o .obj .exe

examples/hello/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ help:
9797
@$(ECHO) " all alias for build"
9898
@$(ECHO) " build compile C++ source files"
9999
@$(ECHO) " clean delete generated files"
100-
@$(ECHO) " doc generate HTML documentation with Doxygen"
100+
@$(ECHO) " doc generate HTML documentation with Doxygen"
101101
@$(ECHO) " help print this help message"
102102
@$(ECHO) " lint analyze C++ source files with CppCheck"
103103
@$(ECHO) " run execute main program \"$(TARGET)\""

examples/ranges/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,4 @@ doc:
126126
.PHONY: all build clean doc help lint run
127127

128128
.SUFFIXES:
129-
.SUFFIXES: .c .cpp .o .obj .exe
129+
.SUFFIXES: .c .cpp .h .hpp .o .obj .exe

examples/ranges/build.bat

+2-2
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ set _STRONG_BG_BLUE=
177177

178178
@rem we define _RESET in last position to avoid crazy console output with type command
179179
set _BOLD=
180-
set _INVERSE=
181180
set _UNDERSCORE=
181+
set _INVERSE=
182182
set _RESET=
183183
goto :eof
184184

@@ -504,7 +504,7 @@ if /i "%PROCESSOR_ARCHITECTURE%"=="AMD64" ( set __ARCH=x64
504504
set "__MSVC_LIBPATH=%MSVC_HOME%lib\%__ARCH%"
505505
set "__ONEAPI_LIBPATH=%ONEAPI_ROOT%\compiler\latest\lib;%ONEAPI_ROOT%\compiler\latest\lib\intel64"
506506
set __LIB_VERSION=
507-
for /f %%i in ('dir /ad /b "%WINSDK_HOME%\Lib\10*" 2^>NUL') do set __LIB_VERSION=%%i
507+
for /f "delims=" %%i in ('dir /ad /b "%WINSDK_HOME%\Lib\10*" 2^>NUL') do set __LIB_VERSION=%%i
508508
if not defined __LIB_VERSION (
509509
echo %_ERROR_LABEL% Windows SDK library path not found 1>&2
510510
set _EXITCODE=1

examples/tuple-iterators/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,4 @@ doc:
116116
.PHONY: all build clean help lint run
117117

118118
.SUFFIXES:
119-
.SUFFIXES: .c .cpp .o .obj .exe
119+
.SUFFIXES: .c .cpp .h .hpp .o .obj .exe

examples/tuple-iterators/build.bat

+5-5
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ set _STRONG_BG_BLUE=
189189

190190
@rem we define _RESET in last position to avoid crazy console output with type command
191191
set _BOLD=
192-
set _INVERSE=
193192
set _UNDERSCORE=
193+
set _INVERSE=
194194
set _RESET=
195195
goto :eof
196196

@@ -338,19 +338,19 @@ echo %__BEG_P%Options:%__END%
338338
echo %__BEG_O%-bcc%__END% use BCC/GNU Make toolset instead of MSVC/MSBuild
339339
echo %__BEG_O%-cl%__END% use MSVC/MSBuild toolset ^(default^)
340340
echo %__BEG_O%-clang%__END% use Clang/GNU Make toolset instead of MSVC/MSBuild
341-
echo %__BEG_O%-debug%__END% display commands executed by this script
341+
echo %__BEG_O%-debug%__END% print commands executed by this script
342342
echo %__BEG_O%-gcc%__END% use GCC/GNU Make toolset instead of MSVC/MSBuild
343343
echo %__BEG_O%-icx%__END% use Intel oneAPI C++ toolset instead of MSVC/MSBuild
344344
echo %__BEG_O%-msvc%__END% use MSVC/MSBuild toolset ^(alias for option %__BEG_O%-cl%__END%^)
345-
echo %__BEG_O%-open%__END% display generated HTML documentation ^(subcommand %__BEG_O%doc%__END%^)
346-
echo %__BEG_O%-verbose%__END% display progress messages
345+
echo %__BEG_O%-open%__END% open generated HTML documentation ^(subcommand %__BEG_O%doc%__END%^)
346+
echo %__BEG_O%-verbose%__END% print progress messages
347347
echo.
348348
echo %__BEG_P%Subcommands:%__END%
349349
echo %__BEG_O%clean%__END% delete generated files
350350
echo %__BEG_O%compile%__END% generate executable
351351
echo %__BEG_O%doc%__END% generate HTML documentation with %__BEG_N%Doxygen%__END%
352352
echo %__BEG_O%dump%__END% dump PE/COFF infos for generated executable
353-
echo %__BEG_O%help%__END% display this help message
353+
echo %__BEG_O%help%__END% print this help message
354354
echo %__BEG_O%lint%__END% analyze C++ source files with %__BEG_N%Cppcheck%__END%
355355
echo %__BEG_O%run%__END% run the generated executable "%__BEG_O%%_EXE_NAME%%__END%"
356356
goto :eof

examples/visitor-pattern/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,4 @@ lint:
105105
.PHONY: all build clean help lint run
106106

107107
.SUFFIXES:
108-
.SUFFIXES: .c .cpp .o .obj .exe
108+
.SUFFIXES: .c .cpp .h .hpp .o .obj .exe

examples/visitor-pattern/build.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ set _STRONG_BG_BLUE=
193193

194194
@rem we define _RESET in last position to avoid crazy console output with type command
195195
set _BOLD=
196-
set _INVERSE=
197196
set _UNDERSCORE=
197+
set _INVERSE=
198198
set _RESET=
199199
goto :eof
200200

grimm-examples/Makefile.inc

+9-8
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,20 @@ endif
2323

2424
TARGET_EXT = .exe
2525
PSEP = ;
26-
CC = $(subst \,/,$(MSYS_HOME))/mingw64/bin/g++.exe
2726
CL = $(subst \,/,$(MSVC_HOME))/bin/Host$(ARCH)/$(ARCH)/cl.exe
2827
CLANG = $(subst \,/,$(LLVM_HOME))/bin/clang.exe
29-
CP = $(subst \,/,$(MSYS_HOME))/usr/bin/cp.exe
30-
ECHO = $(subst \,/,$(MSYS_HOME))/usr/bin/echo.exe
31-
FIND = $(subst \,/,$(MSYS_HOME))/usr/bin/find.exe
3228
ICX = $(subst \,/,$(ONEAPI_ROOT))/compiler/latest/bin/icx.exe
3329
LLC = $(subst \,/,$(LLVM_HOME))/bin/llc.exe
3430
LLVM_CONFIG = $(subst \,/,$(LLVM_HOME))/bin/llvm-config.exe
35-
MKDIR = $(subst \,/,$(MSYS_HOME))/usr/bin/mkdir.exe
36-
RM = $(subst \,/,$(MSYS_HOME))/usr/bin/rm.exe
37-
TEST = $(subst \,/,$(MSYS_HOME))/usr/bin/test.exe
38-
TOUCH = $(subst \,/,$(MSYS_HOME))/usr/bin/touch.exe
31+
## $(MSYS_HOME)\usr\bin\{cp.exe, make.exe, wget.exe}
32+
CC = /usr/bin/g++.exe
33+
CP = /usr/bin/cp.exe
34+
ECHO = /usr/bin/echo.exe
35+
FIND = /usr/bin/find.exe
36+
MKDIR = /usr/bin/mkdir.exe
37+
RM = /usr/bin/rm.exe
38+
TEST = /usr/bin/test.exe
39+
TOUCH = /usr/bin/touch.exe
3940
#
4041
MSVC_INCPATH = $(subst \,/,$(MSVC_HOME))/include
4142
MSVC_LIBPATH = $(subst \,/,$(MSVC_HOME))/lib/$(ARCH)

grimm-examples/README.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,23 @@ readData
5252

5353
## <span id="visitor">`visitor` Example</span> [**&#x25B4;**](#top)
5454

55-
Source file [`visitor.cpp`](./visitor/src/main/cpp/visitor.cpp).
55+
This example has the following directory structure :
56+
57+
<pre style="font-size:80%;">
58+
<b>&gt; <a href="https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/tree" rel="external">tree</a> /a /f . | <a href="https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/findstr" rel="external">findstr</a> /v /b [A-Z]</b>
59+
| <a href="./visitor/00download.txt">00download.txt</a>
60+
| <a href="./visitor/build.bat">build.bat</a>
61+
| <a href="./visitor/build.sh">build.sh</a>
62+
| <a href="./visitor/CMakeLists.txt">CMakeLists.txt</a>
63+
| <a href="./visitor/Doxyfile">Doxyfile
64+
| <a href="./visitor/Makefile">Makefile</a>
65+
\---src
66+
\---main
67+
\---cpp
68+
<a href="./visitor/src/main/cpp/visitor.cpp">visitor.cpp</a>
69+
</pre>
70+
71+
Command [`build.bat`](./visitor/build.bat)`clean run` generates and executes the C++ program `build\Release\visitor.exe` :
5672

5773
<pre style="font-size:80%;">
5874
<b>&gt; <a href="./visitor/build.bat">build</a> -verbose clean run</b>

grimm-examples/templateMethod/Makefile

+18-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ CXX = $(ICX)
4444
CXXFLAGS = -nologo -Qstd=$(CXXSTD) -O2 -Wall -Wno-unused-variable -Fe"$(TARGET)"
4545
CXXLINK = -link -libpath:"$(ONEAPI_LIBPATH)"
4646
else ifeq ($(TOOLSET),msvc)
47+
ifeq (,$(wildcard $(MSVC_INCPATH)))
48+
$(error Variable MSVC_INCPATH is not set)
49+
endif
4750
TARGET_EXE_DIR = $(TARGET_DIR)/$(PROJECT_CONFIG)
4851
CXX = $(CL)
4952
## see https://learn.microsoft.com/en-us/cpp/build/reference/compiler-options-listed-alphabeticall
@@ -93,20 +96,34 @@ help:
9396
@$(ECHO) " all alias for build"
9497
@$(ECHO) " build compile C++ source files"
9598
@$(ECHO) " clean delete generated files"
99+
@$(ECHO) " doc generate HTML documentation with Doxygen"
96100
@$(ECHO) " help print this help message"
97101
@$(ECHO) " lint analyze C++ source files with CppCheck"
98102
@$(ECHO) " run execute main program \"$(TARGET)\""
103+
@$(ECHO) ""
104+
@$(ECHO) " Environment variables:"
105+
@$(ECHO) " TOOLSET=(bcc|clang|gcc|icx|msvc|occ)"
99106

100107
##############################################################################
101108
## lint rules
102109

103110
lint:
104111
"$(CPPCHECK)" $(CPPCHECK_OPTS) "$(SOURCE_DIR)"
105112

113+
##############################################################################
114+
## doc rules
115+
116+
DOXYGEN_OPTS=-s
117+
DOXYFILE=Doxyfile
118+
119+
doc:
120+
[ -d "$(TARGET_DOCS_DIR)" ] || $(MKDIR) -p "$(TARGET_DOCS_DIR)"
121+
"$(DOXYGEN)" $(DOXYGEN_OPTS) "$(DOXYFILE)"
122+
106123
##############################################################################
107124
## phony
108125

109-
.PHONY: all build clean help lint run
126+
.PHONY: all build clean doc help lint run
110127

111128
.SUFFIXES:
112129
.SUFFIXES: .c .cpp .h .hpp .o .obj .exe

0 commit comments

Comments
 (0)