diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0ff0b6c..cce45d1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,7 +9,7 @@ jobs: - uses: actions/checkout@v2 - name: Setup run: | - sudo apt-get install -y libgnutls28-dev g++ libbobcat-dev libgcrypt11-dev libboost-dev flex libfl-dev + sudo apt-get install -y libgnutls28-dev g++ libbobcat-dev libboost-dev flex libfl-dev cmake . - name: Build run: cmake --build . --config Release diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9a2f871..2c5cced 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v1 - name: Setup run: | - sudo apt-get install -y libgnutls28-dev g++ libbobcat-dev libgcrypt11-dev libboost-dev flex libfl-dev pandoc + sudo apt-get install -y libgnutls28-dev g++ libbobcat-dev libboost-dev flex libfl-dev pandoc cmake . - name: Build run: cmake --build . --config Release diff --git a/.gitignore b/.gitignore index cff14f1..2d31d72 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,6 @@ /autom4te.cache /src/sourceScanner/yylex.cc /ccbuild -*.gch \ No newline at end of file +*.gch +/tmp +gmon.out \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 0dc4970..9bc6932 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,15 +1,15 @@ -cmake_minimum_required (VERSION 3.0) +cmake_minimum_required (VERSION 3.5) project (ccbuild) -set (CMAKE_CXX_STANDARD 17) +set (CMAKE_CXX_STANDARD 23) find_package(FLEX) FLEX_TARGET(SourceScanner "src/sourceScanner/lexer" "src/sourceScanner/yylex.cc" ) string(SUBSTRING ${FLEX_VERSION} 0 1 FLEX_VERSION_MAJOR) string(SUBSTRING ${FLEX_VERSION} 2 1 FLEX_VERSION_MINOR) -add_definitions(-DVERSION="v2.0.7-39-gdf7b35c" -DFLEX_VERSION_MAJOR=${FLEX_VERSION_MAJOR} -DFLEX_VERSION_MINOR=${FLEX_VERSION_MINOR}) -link_libraries(gomp bobcat gnutls) +add_definitions(-DVERSION="2.0.9-3-gda70a0d" -DFLEX_VERSION_MAJOR=${FLEX_VERSION_MAJOR} -DFLEX_VERSION_MINOR=${FLEX_VERSION_MINOR}) +link_libraries(gomp gnutls) add_definitions(-fopenmp) add_executable(ccbuild src/ccbuild.cc src/MD5Info/statics.cc src/MD5Info/save.cc src/MD5Info/old.cc src/MD5Info/load.cc src/MD5Info/hashFilenameFor.cc src/MD5Info/getInstance.cc src/MD5Info/destroy.cc src/MD5Info/contentHash.cc src/MD5Info/MD5Info.cc src/options/statics.cc src/system/username.cc src/system/uname.cc src/system/trimmed.cc src/system/trim.cc src/system/system.cc src/system/statics.cc src/system/sleep.cc src/system/resolveTest.cc src/system/projectName.cc src/system/parseArguments.cc src/system/mkdtemp.cc src/system/md5.cc src/system/makefileForAll.cc src/system/makefileFor.cc src/system/localSourcesInto.cc src/system/lib.cc src/system/inspect.cc src/system/icmake.cc src/system/exit.cc src/system/dotgraphForAll.cc src/system/dotgraphFor.cc src/system/distclean.cc src/system/destroy.cc src/system/depsFor.cc src/system/collectTargets.cc src/system/clean.cc src/system/check.cc src/system/changeTo.cc src/system/buildAll.cc src/system/build.cc src/system/batchCompile.cc src/system/addArguments.cc src/system/aapForAll.cc src/system/aapFor.cc src/string/toUpper.cc src/string/replace.cc src/globallocks/statics.cc src/globals/statics.cc src/globals/indexoperator.cc src/globals/globals.cc src/globals/getInstance.cc src/globals/destroy.cc src/fileSystem/touch.cc src/fileSystem/rmIfExists.cc src/fileSystem/rmDirectoryIfExists.cc src/fileSystem/rename.cc src/fileSystem/recursiveGlobDirectoriesInto.cc src/fileSystem/newer.cc src/fileSystem/modTime.cc src/fileSystem/isReadable.cc src/fileSystem/isDirectory.cc src/fileSystem/globSourceFilesInto.cc src/fileSystem/globInto.cc src/fileSystem/globFilesInto.cc src/fileSystem/globDirectoriesInto.cc src/fileSystem/fileName.cc src/fileSystem/fileExists.cc src/fileSystem/ensureDirectory.cc src/fileSystem/directoryName.cc src/fileSystem/cwd.cc src/fileSystem/cleanPath.cc src/fileSystem/baseName.cc src/fileSystem/absolutePath.cc src/problem/problem.cc src/resolver/statics.cc src/resolver/resolver.cc src/resolver/resolveInto.cc src/resolver/resolve.cc src/resolver/loadIfExists.cc src/resolver/getInstance.cc src/resolver/expand.cc src/resolver/destroy.cc src/compiler/statics.cc src/compiler/splitInto.cc src/compiler/precompileCommand.cc src/compiler/precompile.cc src/compiler/operator_add.cc src/compiler/linkCommand.cc src/compiler/link.cc src/compiler/libCommand.cc src/compiler/lib.cc src/compiler/countFirstLinkerArguments.cc src/compiler/compileCommand.cc src/compiler/compile.cc src/compiler/cls.cc src/compiler/ar.cc src/compiler/addObject.cc src/compiler/addArgument.cc src/sources/statics.cc src/sources/sources.cc src/sources/reloadStaleSources.cc src/sources/indexoperator.cc src/sources/getInstance.cc src/sources/erase.cc src/sources/destroy.cc src/source/upToDate.cc src/source/stale.cc src/source/source.cc src/source/setType.cc src/source/scan.cc src/source/reload.cc src/source/producesOutput.cc src/source/outputFilename.cc src/source/markAsDone.cc src/source/isObjectTarget.cc src/source/isLocalHeader.cc src/source/isLibTarget.cc src/source/isInternalHeader.cc src/source/isHeader.cc src/source/isBinTarget.cc src/source/hasSourceExtension.cc src/source/genDeps.cc src/source/directory.cc src/source/directDeps.cc src/source/dependencies.cc src/source/changed.cc src/source/buildObjectTarget.cc src/source/buildHeader.cc src/source/buildBinTarget.cc src/source/build.cc src/source/basenameWithoutExtension.cc src/sourceScanner/storeLocal.cc src/sourceScanner/storeIgnore.cc src/sourceScanner/storeGlobal.cc src/sourceScanner/sourceScanner.cc src/sourceScanner/includes.cc src/sourceScanner/hasMainFunction.cc src/sourceScanner/hasDefine.cc src/arguments/values.cc src/arguments/value.cc src/arguments/statics.cc src/arguments/outputOptions.cc src/arguments/initialize.cc src/arguments/getInstance.cc src/arguments/flagged.cc src/arguments/destroy.cc src/arguments/clear.cc src/arguments/arguments.cc ${FLEX_SourceScanner_OUTPUTS}) install(TARGETS ccbuild DESTINATION bin) diff --git a/MD5SUMS b/MD5SUMS index b6e7312..fd9527c 100644 --- a/MD5SUMS +++ b/MD5SUMS @@ -1,6 +1,6 @@ f1cbc85bea3f70d88362d7e7989a6074 src/ccbuild.cc bad9bd0cafa0b1552f03b4ec3799783c src/misc/debug.hh -1eb06a3c7cd7be60632055d44f2dbd5b src/MD5Info/MD5Info.hh +48298fd9899a634a15644cbe1ac3a754 src/MD5Info/MD5Info.hh ca475bbd58f6c3096f945ccb5f307ec0 src/MD5Info/statics.cc 1aa3a0f0ddfc2c30d8d754da153efa45 src/MD5Info/MD5Info.ih 6c8662c8d1d75633db009bea901eb21d src/MD5Info/save.cc diff --git a/doc/ccbuild/ccbuild.1 b/doc/ccbuild/ccbuild.1 index e444894..acbe997 100644 --- a/doc/ccbuild/ccbuild.1 +++ b/doc/ccbuild/ccbuild.1 @@ -1,37 +1,32 @@ -.\" Automatically generated by Pandoc 2.11.3 +.\" Automatically generated by Pandoc 3.2 .\" .TH "ccbuild" "1" "August 8, 2014" "General Commands Manual" "" -.hy .SH NAME -.PP ccbuild \[em] Strict C++ developer\[cq]s build utility .SH SYNOPSIS -.PP \f[B]ccbuild\f[R] options [command] .SH DESCRIPTION -.PP \f[B]ccbuild\f[R] is a build utility that will read C++ source. It collects all source surrounding your local includes and links these to your main program. Global include statements (#include ) are used to make sure the compiler gets the\[ga] right arguments. -The link between com\[hy] piler arguments and these global includes is -made using configuration files. +The link between com‐ piler arguments and these global includes is made +using configuration files. These files contain lines with a global header file name and the extra arguments the compiler needs to find and use this file. The file name and arguments are separated by tab character(s) or a space. ccbuild reads these configuration files in order. -Only the first men\[hy] tion of a global header file in these files is -used. +Only the first men‐ tion of a global header file in these files is used. Usually only \f[B]./ccResolutions\f[R] is used, but there are more possibilities. -See the sec\[hy] tion FILES for more information. +See the sec‐ tion FILES for more information. .PP \f[B]ccbuild\f[R] will follow any local include (#include \[lq]something.hh\[rq]) to try to find more source code to compile. To keep \f[B]ccbuild\f[R] from following up on an include statement, -separate the #-sign and the include statement by a single space (\[lq]# +separate the #\-sign and the include statement by a single space (\[lq]# include\[rq]). .SH COMMANDS .TP @@ -42,13 +37,13 @@ lib [filename.cc] Collect all objects into an archive. If a version is given, using \[en]pversion, then a shared library is also build with symbolic links. -This currently forces the -fPIC argument addition. +This currently forces the \-fPIC argument addition. The name of your library is given the name of the current directory or it\[cq]s parent when the current directory is called src. .RS .PP Example: create an empty .cc file which simply includes all the local -libraries, run ccbuild \[en]pversion 0.0.1 lib that\[hy] file.cc +libraries, run ccbuild \[en]pversion 0.0.1 lib that‐ file.cc .RE .TP clean [filename.cc] @@ -80,9 +75,9 @@ If no file name is given, an all rule will be generated. Otherwise only the rules for the given file are generated. .TP aap [filename.cc] -Generate an A-A-P file on stdout. +Generate an A\-A\-P file on stdout. If the file name is not given, an \[lq]all\[rq] rule will be added and -all local binary tar\[hy] gets will be listed. +all local binary tar‐ gets will be listed. .TP check [filename.cc] Display source status and file name on the stdout. @@ -101,8 +96,8 @@ If a CLASSES file already exists, it will only output the class directories not mentioned in the CLASSES file. If \[en]verbose is given, all classes will be listed. The output will not contain directories with only header files. -Updating the CLASSES is typically done by run\[hy] ning: ccbuild icmake ->> CLASSES +Updating the CLASSES is typically done by run‐ ning: ccbuild icmake >> +CLASSES .TP resolve [filename.cc] Print all unresolved globals onto the stdout followed by a tab @@ -114,14 +109,13 @@ md5 [filename.cc] MD5 sum all sources needed to compile all binary targets, or the given source on stdout. .SH OPTIONS -.PP Options are used to change the behaviour of the commands. Some options are useless for some commands. .TP --f \[en]force-update +\-f \[en]force\-update Update everything by labelling everything as old. .TP --h \[en]help +\-h \[en]help Get a list of options and commands. .TP \[en]gnutouch @@ -131,30 +125,30 @@ in the current directory, then the current directory will be used. This will touch AUTHORS, NEWS, README, INSTALL, COPYING, TODO and ChangeLog. .TP --s \[en]no-act +\-s \[en]no\-act Simulate, don\[cq]t really execute any writing commands. .TP \[en]compiler cmd Set the compiler command. The default is \[lq]g++\[rq]. .TP --a \[en]args argument +\-a \[en]args argument Set these default compiler arguments, removing the standard default -arguments (\[lq]-Wall -g\[rq]). -Multiple uses of this option are concate\[hy] nated with spaces. +arguments (\[lq]\-Wall \-g\[rq]). +Multiple uses of this option are concate‐ nated with spaces. .TP --C path +\-C path Change directory before anything else. .TP --p \[en]precompile-ih -Pre-compile only internal headers. +\-p \[en]precompile\-ih +Pre\-compile only internal headers. This requires g++ version 3.4 up. .TP -\[en]precompile-all -Pre-compile both internal headers and normal headers. +\[en]precompile\-all +Pre\-compile both internal headers and normal headers. This requires g++ version 3.4 up. When you use internal headers, this will only slow you down. -However, when you don\[cq]t use internal headers, this pre-compilation +However, when you don\[cq]t use internal headers, this pre\-compilation is all you\[cq]ve got. .TP \[en]brute @@ -166,36 +160,36 @@ The hashes are store in \[lq]o/filename.md5\[rq] for every file. These sums are only stored after a clean exit from ccbuild (last line showing \[lq][WR] MD5 data\[rq]) or a successful compilation. .TP --I path +\-I path Add this path to the local include search path of ccbuild and the compiler (which will receive the same argument). .TP -\[en]recursive-include path -This is just like -I, but for the given path and every non-empty +\[en]recursive\-include path +This is just like \-I, but for the given path and every non\-empty directory with a name other then \[lq]o\[rq]. Make sure you do not come to depend on this behaviour, that would be bad practice. .TP --l \[en]highlight +\-l \[en]highlight Highlight the output of the compiler using a red terminal colour. .TP -\[en]xof \[en]exec-on-fail command -Execute this command when the command (pre)compilation returns any\[hy] +\[en]xof \[en]exec\-on\-fail command +Execute this command when the command (pre)compilation returns any‐ thing but 0. -The first argument given to the command will be rela\[hy] tive path to -the file the command was executed on (which is either a C++ source or +The first argument given to the command will be rela‐ tive path to the +file the command was executed on (which is either a C++ source or header). If you don\[cq]t want to use the file name, you can append an echo command like \[lq]sleep 2; echo\[rq]. .TP -\[en]xop \[en]exec-on-pass cmd -This is the same as \[en]exec-on-fail, except it only works when the +\[en]xop \[en]exec\-on\-pass cmd +This is the same as \[en]exec\-on\-fail, except it only works when the command returns 0. The first argument given to the command will be the relative path to the file the command was executed on. .TP \[en]clearpc -Clear the screen just before executing the command (clear per com\[hy] +Clear the screen just before executing the command (clear per com‐ mand). .TP \[en]append cmd @@ -213,15 +207,15 @@ Do not read the first line of ./ccResolutions for extra arguments. .TP \[en]nodefres Do not load any ccResolutions files outside of ./ccResolutions. -This can be used to create a monolithic ccResolutions file or dis\[hy] -cover your project\[cq]s dependencies with the resolve command. +This can be used to create a monolithic ccResolutions file or dis‐ cover +your project\[cq]s dependencies with the resolve command. .TP \[en]addres filename Load the given resolution file before any other. .TP \[en]pversion version Set the program version you are working on to version. -This is cur\[hy] rently only used for the library command. +This is cur‐ rently only used for the library command. When defined, the library command can make a shared object (.so) and symbolic links by using the version number. It should not contain any file system special characters like slashes. @@ -233,7 +227,7 @@ This should reduce the binary size because it leaves out unused objects. \[en]verbose Show commands and produce more output for dot and check commands. .TP --V \[en]version +\-V \[en]version Output version number on stdout and copyright/license on stderr. .TP \[en]xml @@ -244,33 +238,31 @@ Currently this is only the check command. Leave out most warnings. .TP \[en]batch -Compile a batch of files with one g++ call before any other compi\[hy] +Compile a batch of files with one g++ call before any other compi‐ lation. -This effectively disables any multi-threading, but may speed things up +This effectively disables any multi\-threading, but may speed things up for larger collections of small files. This process involves creating a temporary directory in /tmp/ccbuild_batch.XXXX. The exact behaviour of this option may change in the future based on performance results and user experience. .TP --j number_threads +\-j number_threads Set the maximum number of threads used during build. Only available when OpenMP is enabled. .SH RESOLUTION CONFIGURATION -.PP The ccResolutions file links global headers to compiler arguments. Every line should be either empty, start with a comment character -\[lq]#\[rq] or contain a con\[hy] figuration line. +\[lq]#\[rq] or contain a con‐ figuration line. A configuration line contains the name of the global header, followed by -one or more tab characters and then the additional argu\[hy] ments -needed when a source depends on this global header. +one or more tab characters and then the additional argu‐ ments needed +when a source depends on this global header. The arguments are POSIX shell expanded. .PP If the first line of the ccResolutions file starts with \[lq]#&\[rq], the rest of this line is shell expanded and used and appended to the argument list of \f[I]ccbuild\f[R]. .SH EXAMPLES -.PP Examples of program use. .TP ccbuild resolve >> ccResolutions @@ -283,21 +275,21 @@ Get back to development after a distclean. This will update as much objects as will compile. Which will allow you to focus on the errors in the next ccbuild call. .TP -ccbuild -p \[en]compiler `g++-3.4' \[en]args -Wall \[en]args `-Wextra -ansi' -Precompile internal headers using g++-3.4 and highlight all com\[hy] -piler output (-l). -Also give all compiler commands the parameters \[lq]-Wall -Wextra --ansi\[rq]. +ccbuild \-p \[en]compiler `g++\-3.4' \[en]args \-Wall \[en]args `\-Wextra \-ansi' +Precompile internal headers using g++\-3.4 and highlight all com‐ piler +output (\-l). +Also give all compiler commands the parameters \[lq]\-Wall \-Wextra +\-ansi\[rq]. .TP -ccbuild -f \[en]args -O3 +ccbuild \-f \[en]args \-O3 Recompiling your project for benchmarking tests. -Forces the update of all code (-f) and sets the compiler argument to --O3. +Forces the update of all code (\-f) and sets the compiler argument to +\-O3. .TP ccbuild \[en]verbose dot; dotty *.dot Graph the dependencies for all programs with colours. Then view these using dotty. -This can help you to discover irregular depen\[hy] dencies and what test +This can help you to discover irregular depen‐ dencies and what test programs use. .TP ccbuild \[en]xof `gedit' @@ -306,18 +298,17 @@ correctly. Open all error producing sources in gedit. Very useful for when you change the interface of a class. .TP -ccbuild \[en]compiler distcc -j 20 +ccbuild \[en]compiler distcc \-j 20 Use 20 distcc compilers to compile the project. .SH FILES -.PP Configuration files used by ccbuild .TP \&./ccResolutions[.USERNAME,.HOSTNAME,.KERNEL_NAME,.MACHINE,] Local configuration which is project specific. It will load the first existing file of: ./ccResolutions.USERNAME, -\&./ccResolu\[hy] tions.HOSTNAME, ./ccResolutions.KERNEL_NAME, -\&./ccResolu\[hy] tions.MACHINE, ./ccResolutions. -Hostname, kernel name and machine can be found with uname -nsm. +\&./ccResolu‐ tions.HOSTNAME, ./ccResolutions.KERNEL_NAME, ./ccResolu‐ +tions.MACHINE, ./ccResolutions. +Hostname, kernel name and machine can be found with uname \-nsm. .TP \[ti]/.ccbuild/ccResolutions Global configuration file. @@ -326,7 +317,6 @@ Global configuration file. The resolution configuration directory. All files in this directory are considered configuration files. .SH CAVEATS -.PP Do not place any file into o directories, these will be removed when using the distclean command. Also don\[cq]t use files with the same basename, but different C++ @@ -334,11 +324,11 @@ extensions, this will give problems with the objects created (for example \[lq]add.cc\[rq] and \[lq]add.cpp\[rq] in the same directory). .PP Currently there is no way to allow one object file to effect the -command-line parameters of another. +command\-line parameters of another. This means that if all objects need a flag, you must use the \[en]args argument and cannot use a global header resolution line. -Exam\[hy] ples of these flags that need to be defined everywhere are --pthreads, -mthreads and -threads. +Exam‐ ples of these flags that need to be defined everywhere are +\-pthreads, \-mthreads and \-threads. Please read the g++ manual for more information on usage of flags. .PP ccbuild seems to be incompatible with flex 2.5.4. @@ -350,20 +340,19 @@ test program for your class and won\[cq]t link it into the main program. A solution is to move to a newer version of flex or find a way to remove the int main function from the resulting scanner file. .SH REPORTING BUGS -.PP Report any issue with ccbuild at: https://github.com/bneijt/ccbuild .SH RESTRICTIONS -.PP ccbuild will not follow or act on any include statements with a single -space between the #-sign and the include. +space between the #\-sign and the include. So all include statements starting with \[lq]# include\[rq] will be ignored, all other combinations will be acted on. This is a feature, not a bug. In verbose mode (\[en]verbose) these are mentioned as warnings. .SH SEE ALSO -.PP -\f[C]pkg-config\f[R](1), \f[C]dotty\f[R](1), \f[C]make\f[R](1), -\f[C]icmake\f[R](1), \f[C]g++\f[R](1), \f[C]aap\f[R](1), -\f[C]svn\f[R](1) +\f[CR]pkg\-config\f[R](1), \f[CR]dotty\f[R](1), \f[CR]make\f[R](1), +\f[CR]icmake\f[R](1), \f[CR]g++\f[R](1), \f[CR]aap\f[R](1), +\f[CR]svn\f[R](1) .SH AUTHORS -A. Bram Neijt . +A. Bram Neijt \c +.MT bneijt@gmail.com +.ME \c. diff --git a/doc/ccbuild/ccbuild.sgml b/doc/ccbuild/ccbuild.sgml index 8db7597..de516a0 100644 --- a/doc/ccbuild/ccbuild.sgml +++ b/doc/ccbuild/ccbuild.sgml @@ -5,7 +5,7 @@ &ccb; - A strict developer's build utility <author>A. Bram Neijt - <version>v2.0.7-39-gdf7b35c + <version>2.0.9-3-gda70a0d <abstract>This document is a general usage manual to &ccb;. It will introduce ways of using &ccb;. It will also explain &ccb;'s behaviour in more words then the manual does. The newest version of &ccb; can be found at the <url name="https://github.com/bneijt/ccbuild" id="https://github.com/bneijt/ccbuild"> diff --git a/doc/ccbuild/ccbuildman.html b/doc/ccbuild/ccbuildman.html index d54c765..934665c 100644 --- a/doc/ccbuild/ccbuildman.html +++ b/doc/ccbuild/ccbuildman.html @@ -9,9 +9,6 @@ <title>ccbuild(1) General Commands Manual -

ccbuild(1) General Commands Manual

-

A. Bram Neijt

+

A. Bram Neijt bneijt@gmail.com

August 8, 2014

NAME

@@ -161,192 +182,373 @@

NAME

SYNOPSIS

ccbuild options [command]

DESCRIPTION

-

ccbuild is a build utility that will read C++ source. It collects all source surrounding your local includes and links these to your main program. Global include statements (#include ) are used to make sure the compiler gets the` right arguments. The link between com‐ piler arguments and these global includes is made using configuration files. These files contain lines with a global header file name and the extra arguments the compiler needs to find and use this file. The file name and arguments are separated by tab character(s) or a space. ccbuild reads these configuration files in order. Only the first men‐ tion of a global header file in these files is used. Usually only ./ccResolutions is used, but there are more possibilities. See the sec‐ tion FILES for more information.

-

ccbuild will follow any local include (#include “something.hh”) to try to find more source code to compile. To keep ccbuild from following up on an include statement, separate the #-sign and the include statement by a single space (“# include”).

+

ccbuild is a build utility that will read C++ +source. It collects all source surrounding your local includes and links +these to your main program. Global include statements (#include +) are used to make sure the compiler gets the` right +arguments. The link between com‐ piler arguments and these global +includes is made using configuration files. These files contain lines +with a global header file name and the extra arguments the compiler +needs to find and use this file. The file name and arguments are +separated by tab character(s) or a space. ccbuild reads these +configuration files in order. Only the first men‐ tion of a global +header file in these files is used. Usually only +./ccResolutions is used, but there are more +possibilities. See the sec‐ tion FILES for more information.

+

ccbuild will follow any local include (#include +“something.hh”) to try to find more source code to compile. To keep +ccbuild from following up on an include statement, +separate the #-sign and the include statement by a single space (“# +include”).

COMMANDS

build [filename.cc]
-
Build everything or the given source. +
+Build everything or the given source.
lib [filename.cc]
-

Collect all objects into an archive. If a version is given, using –pversion, then a shared library is also build with symbolic links. This currently forces the -fPIC argument addition. The name of your library is given the name of the current directory or it’s parent when the current directory is called src.

-

Example: create an empty .cc file which simply includes all the local libraries, run ccbuild –pversion 0.0.1 lib that‐ file.cc

+
+

Collect all objects into an archive. If a version is given, using +–pversion, then a shared library is also build with symbolic links. This +currently forces the -fPIC argument addition. The name of your library +is given the name of the current directory or it’s parent when the +current directory is called src.

+

Example: create an empty .cc file which simply includes all the local +libraries, run ccbuild –pversion 0.0.1 lib that‐ file.cc

clean [filename.cc]
-
Clean everything or the given source. +
+Clean everything or the given source.
distclean
-
Recursively remove all “o” directories after removing all .md5 and .o files therein. And removes all .gch files. +
+Recursively remove all “o” directories after removing all .md5 and .o +files therein. And removes all .gch files.
deps [filename.cc]
-
List all files this source depends on. It lists three lines separated by empty lines. The first contains the local dependencies, the second the ignored headers (for the file) and the last contains all global includes needed. +
+List all files this source depends on. It lists three lines separated by +empty lines. The first contains the local dependencies, the second the +ignored headers (for the file) and the last contains all global includes +needed.
dot [filename.cc]
-
Generate dot graph files for sources on the stdout. If no source file name is given, then for all binary targets in the local directory a .dot file will be created. If the –verbose flag is used the dot graph will also contain all object file names and their dependencies and lists of ignored headers. Objects will be coloured light grey, binary targets light blue, ignored headers by a red line. +
+Generate dot graph files for sources on the stdout. If no source file +name is given, then for all binary targets in the local directory a .dot +file will be created. If the –verbose flag is used the dot graph will +also contain all object file names and their dependencies and lists of +ignored headers. Objects will be coloured light grey, binary targets +light blue, ignored headers by a red line.
makefile [filename.cc]
-
Generate a Makefile on stdout. If no file name is given, an all rule will be generated. Otherwise only the rules for the given file are generated. +
+Generate a Makefile on stdout. If no file name is given, an all rule +will be generated. Otherwise only the rules for the given file are +generated.
aap [filename.cc]
-
Generate an A-A-P file on stdout. If the file name is not given, an “all” rule will be added and all local binary tar‐ gets will be listed. +
+Generate an A-A-P file on stdout. If the file name is not given, an +“all” rule will be added and all local binary tar‐ gets will be listed.
check [filename.cc]
-
Display source status and file name on the stdout. Status and source path are separated with a tab character. Status is either “old” or “ok”. When the –verbose flag is used, another tab separated column will be inserted containing a two letter file type ccbuild identifies it as. This file type is “bt”, “ot”, “ih” or “hh” for binary target, object target, internal header and header respectively. +
+Display source status and file name on the stdout. Status and source +path are separated with a tab character. Status is either “old” or “ok”. +When the –verbose flag is used, another tab separated column will be +inserted containing a two letter file type ccbuild identifies it as. +This file type is “bt”, “ot”, “ih” or “hh” for binary target, object +target, internal header and header respectively.
icmake [filename.cc]
-
icmake slave mode. This will output the used directories with one directory per line. If a CLASSES file already exists, it will only output the class directories not mentioned in the CLASSES file. If –verbose is given, all classes will be listed. The output will not contain directories with only header files. Updating the CLASSES is typically done by run‐ ning: ccbuild icmake >> CLASSES +
+icmake slave mode. This will output the used directories with one +directory per line. If a CLASSES file already exists, it will only +output the class directories not mentioned in the CLASSES file. If +–verbose is given, all classes will be listed. The output will not +contain directories with only header files. Updating the CLASSES is +typically done by run‐ ning: ccbuild icmake >> CLASSES
resolve [filename.cc]
-
Print all unresolved globals onto the stdout followed by a tab character. These can be appended to the ccResolutions file using: ccbuild resolve >> ccResolutions . +
+Print all unresolved globals onto the stdout followed by a tab +character. These can be appended to the ccResolutions file using: +ccbuild resolve >> ccResolutions .
md5 [filename.cc]
-
MD5 sum all sources needed to compile all binary targets, or the given source on stdout. +
+MD5 sum all sources needed to compile all binary targets, or the given +source on stdout.

OPTIONS

-

Options are used to change the behaviour of the commands. Some options are useless for some commands.

+

Options are used to change the behaviour of the commands. Some +options are useless for some commands.

-f –force-update
-
Update everything by labelling everything as old. +
+Update everything by labelling everything as old.
-h –help
-
Get a list of options and commands. +
+Get a list of options and commands.
–gnutouch
-
Touch files part of the GNU software standard. They will be touched in ../ except when there is a directory called src in the current directory, then the current directory will be used. This will touch AUTHORS, NEWS, README, INSTALL, COPYING, TODO and ChangeLog. +
+Touch files part of the GNU software standard. They will be touched in +../ except when there is a directory called src in the current +directory, then the current directory will be used. This will touch +AUTHORS, NEWS, README, INSTALL, COPYING, TODO and ChangeLog.
-s –no-act
-
Simulate, don’t really execute any writing commands. +
+Simulate, don’t really execute any writing commands.
–compiler cmd
-
Set the compiler command. The default is “g++”. +
+Set the compiler command. The default is “g++”.
-a –args argument
-
Set these default compiler arguments, removing the standard default arguments (“-Wall -g”). Multiple uses of this option are concate‐ nated with spaces. +
+Set these default compiler arguments, removing the standard default +arguments (“-Wall -g”). Multiple uses of this option are concate‐ nated +with spaces.
-C path
-
Change directory before anything else. +
+Change directory before anything else.
-p –precompile-ih
-
Pre-compile only internal headers. This requires g++ version 3.4 up. +
+Pre-compile only internal headers. This requires g++ version 3.4 up.
–precompile-all
-
Pre-compile both internal headers and normal headers. This requires g++ version 3.4 up. When you use internal headers, this will only slow you down. However, when you don’t use internal headers, this pre-compilation is all you’ve got. +
+Pre-compile both internal headers and normal headers. This requires g++ +version 3.4 up. When you use internal headers, this will only slow you +down. However, when you don’t use internal headers, this pre-compilation +is all you’ve got.
–brute
-
Continue on compiler errors. +
+Continue on compiler errors.
–md5
-
Use MD5 hashes to check for file changes. The hashes are store in “o/filename.md5” for every file. These sums are only stored after a clean exit from ccbuild (last line showing “[WR] MD5 data”) or a successful compilation. +
+Use MD5 hashes to check for file changes. The hashes are store in +“o/filename.md5” for every file. These sums are only stored after a +clean exit from ccbuild (last line showing “[WR] MD5 data”) or a +successful compilation.
-I path
-
Add this path to the local include search path of ccbuild and the compiler (which will receive the same argument). +
+Add this path to the local include search path of ccbuild and the +compiler (which will receive the same argument).
–recursive-include path
-
This is just like -I, but for the given path and every non-empty directory with a name other then “o”. Make sure you do not come to depend on this behaviour, that would be bad practice. +
+This is just like -I, but for the given path and every non-empty +directory with a name other then “o”. Make sure you do not come to +depend on this behaviour, that would be bad practice.
-l –highlight
-
Highlight the output of the compiler using a red terminal colour. +
+Highlight the output of the compiler using a red terminal colour.
–xof –exec-on-fail command
-
Execute this command when the command (pre)compilation returns any‐ thing but 0. The first argument given to the command will be rela‐ tive path to the file the command was executed on (which is either a C++ source or header). If you don’t want to use the file name, you can append an echo command like “sleep 2; echo”. +
+Execute this command when the command (pre)compilation returns any‐ +thing but 0. The first argument given to the command will be rela‐ tive +path to the file the command was executed on (which is either a C++ +source or header). If you don’t want to use the file name, you can +append an echo command like “sleep 2; echo”.
–xop –exec-on-pass cmd
-
This is the same as –exec-on-fail, except it only works when the command returns 0. The first argument given to the command will be the relative path to the file the command was executed on. +
+This is the same as –exec-on-fail, except it only works when the command +returns 0. The first argument given to the command will be the relative +path to the file the command was executed on.
–clearpc
-
Clear the screen just before executing the command (clear per com‐ mand). +
+Clear the screen just before executing the command (clear per com‐ +mand).
–append cmd
-
Append this to every command. This can be used to redirect output or set up pipes for compiler output. +
+Append this to every command. This can be used to redirect output or set +up pipes for compiler output.
–loop
-
Loop the system with one second intervals. This only works for the build command at the moment. All sources who are touched will be reloaded. If a file is removed, the whole source tree is reloaded. +
+Loop the system with one second intervals. This only works for the build +command at the moment. All sources who are touched will be reloaded. If +a file is removed, the whole source tree is reloaded.
–nodefargs
-
Do not read the first line of ./ccResolutions for extra arguments. +
+Do not read the first line of ./ccResolutions for extra arguments.
–nodefres
-
Do not load any ccResolutions files outside of ./ccResolutions. This can be used to create a monolithic ccResolutions file or dis‐ cover your project’s dependencies with the resolve command. +
+Do not load any ccResolutions files outside of ./ccResolutions. This can +be used to create a monolithic ccResolutions file or dis‐ cover your +project’s dependencies with the resolve command.
–addres filename
-
Load the given resolution file before any other. +
+Load the given resolution file before any other.
–pversion version
-
Set the program version you are working on to version. This is cur‐ rently only used for the library command. When defined, the library command can make a shared object (.so) and symbolic links by using the version number. It should not contain any file system special characters like slashes. +
+Set the program version you are working on to version. This is cur‐ +rently only used for the library command. When defined, the library +command can make a shared object (.so) and symbolic links by using the +version number. It should not contain any file system special characters +like slashes.
–ar
-
Archive the objects before linking. This should reduce the binary size because it leaves out unused objects. +
+Archive the objects before linking. This should reduce the binary size +because it leaves out unused objects.
–verbose
-
Show commands and produce more output for dot and check commands. +
+Show commands and produce more output for dot and check commands.
-V –version
-
Output version number on stdout and copyright/license on stderr. +
+Output version number on stdout and copyright/license on stderr.
–xml
-
Output in XML where supported. Currently this is only the check command. +
+Output in XML where supported. Currently this is only the check command.
–nowarn
-
Leave out most warnings. +
+Leave out most warnings.
–batch
-
Compile a batch of files with one g++ call before any other compi‐ lation. This effectively disables any multi-threading, but may speed things up for larger collections of small files. This process involves creating a temporary directory in /tmp/ccbuild_batch.XXXX. The exact behaviour of this option may change in the future based on performance results and user experience. +
+Compile a batch of files with one g++ call before any other compi‐ +lation. This effectively disables any multi-threading, but may speed +things up for larger collections of small files. This process involves +creating a temporary directory in /tmp/ccbuild_batch.XXXX. The exact +behaviour of this option may change in the future based on performance +results and user experience.
-j number_threads
-
Set the maximum number of threads used during build. Only available when OpenMP is enabled. +
+Set the maximum number of threads used during build. Only available when +OpenMP is enabled.

RESOLUTION CONFIGURATION

-

The ccResolutions file links global headers to compiler arguments. Every line should be either empty, start with a comment character “#” or contain a con‐ figuration line. A configuration line contains the name of the global header, followed by one or more tab characters and then the additional argu‐ ments needed when a source depends on this global header. The arguments are POSIX shell expanded.

-

If the first line of the ccResolutions file starts with “#&”, the rest of this line is shell expanded and used and appended to the argument list of ccbuild.

+

The ccResolutions file links global headers to compiler arguments. +Every line should be either empty, start with a comment character “#” or +contain a con‐ figuration line. A configuration line contains the name +of the global header, followed by one or more tab characters and then +the additional argu‐ ments needed when a source depends on this global +header. The arguments are POSIX shell expanded.

+

If the first line of the ccResolutions file starts with “#&”, the +rest of this line is shell expanded and used and appended to the +argument list of ccbuild.

EXAMPLES

Examples of program use.

ccbuild resolve >> ccResolutions
-
Add any of the unknown global headers to the ccResolutions file. You can also use –nowarn to keep ccbuild quiet, but you will have to think twice if you get compilation errors. +
+Add any of the unknown global headers to the ccResolutions file. You can +also use –nowarn to keep ccbuild quiet, but you will have to think twice +if you get compilation errors.
ccbuild –brute
-
Get back to development after a distclean. This will update as much objects as will compile. Which will allow you to focus on the errors in the next ccbuild call. -
-
ccbuild -p –compiler ‘g++-3.4’ –args -Wall –args ‘-Wextra -ansi’
-
Precompile internal headers using g++-3.4 and highlight all com‐ piler output (-l). Also give all compiler commands the parameters “-Wall -Wextra -ansi”. +
+Get back to development after a distclean. This will update as much +objects as will compile. Which will allow you to focus on the errors in +the next ccbuild call. +
+
ccbuild -p –compiler ‘g++-3.4’ –args -Wall –args ‘-Wextra +-ansi’
+
+Precompile internal headers using g++-3.4 and highlight all com‐ piler +output (-l). Also give all compiler commands the parameters “-Wall +-Wextra -ansi”.
ccbuild -f –args -O3
-
Recompiling your project for benchmarking tests. Forces the update of all code (-f) and sets the compiler argument to -O3. +
+Recompiling your project for benchmarking tests. Forces the update of +all code (-f) and sets the compiler argument to -O3.
ccbuild –verbose dot; dotty *.dot
-
Graph the dependencies for all programs with colours. Then view these using dotty. This can help you to discover irregular depen‐ dencies and what test programs use. +
+Graph the dependencies for all programs with colours. Then view these +using dotty. This can help you to discover irregular depen‐ dencies and +what test programs use.
ccbuild –xof ‘gedit’
-
Try to compile the program and open the first file that does not compile correctly. Open all error producing sources in gedit. Very useful for when you change the interface of a class. +
+Try to compile the program and open the first file that does not compile +correctly. Open all error producing sources in gedit. Very useful for +when you change the interface of a class.
ccbuild –compiler distcc -j 20
-
Use 20 distcc compilers to compile the project. +
+Use 20 distcc compilers to compile the project.

FILES

Configuration files used by ccbuild

./ccResolutions[.USERNAME,.HOSTNAME,.KERNEL_NAME,.MACHINE,]
-
Local configuration which is project specific. It will load the first existing file of: ./ccResolutions.USERNAME, ./ccResolu‐ tions.HOSTNAME, ./ccResolutions.KERNEL_NAME, ./ccResolu‐ tions.MACHINE, ./ccResolutions. Hostname, kernel name and machine can be found with uname -nsm. +
+Local configuration which is project specific. It will load the first +existing file of: ./ccResolutions.USERNAME, ./ccResolu‐ tions.HOSTNAME, +./ccResolutions.KERNEL_NAME, ./ccResolu‐ tions.MACHINE, ./ccResolutions. +Hostname, kernel name and machine can be found with uname -nsm.
~/.ccbuild/ccResolutions
-
Global configuration file. +
+Global configuration file.
~/.ccbuild/ccResolutions.d
-
The resolution configuration directory. All files in this directory are considered configuration files. +
+The resolution configuration directory. All files in this directory are +considered configuration files.

CAVEATS

-

Do not place any file into o directories, these will be removed when using the distclean command. Also don’t use files with the same basename, but different C++ extensions, this will give problems with the objects created (for example “add.cc” and “add.cpp” in the same directory).

-

Currently there is no way to allow one object file to effect the command-line parameters of another. This means that if all objects need a flag, you must use the –args argument and cannot use a global header resolution line. Exam‐ ples of these flags that need to be defined everywhere are -pthreads, -mthreads and -threads. Please read the g++ manual for more information on usage of flags.

-

ccbuild seems to be incompatible with flex 2.5.4. That version of flex places an int main function in the resulting scanner and there doesn’t seem to be a way to stop it from mentioning it. The result is that ccbuild will think that the generated scanner is a test program for your class and won’t link it into the main program. A solution is to move to a newer version of flex or find a way to remove the int main function from the resulting scanner file.

+

Do not place any file into o directories, these will be removed when +using the distclean command. Also don’t use files with the same +basename, but different C++ extensions, this will give problems with the +objects created (for example “add.cc” and “add.cpp” in the same +directory).

+

Currently there is no way to allow one object file to effect the +command-line parameters of another. This means that if all objects need +a flag, you must use the –args argument and cannot use a global header +resolution line. Exam‐ ples of these flags that need to be defined +everywhere are -pthreads, -mthreads and -threads. Please read the g++ +manual for more information on usage of flags.

+

ccbuild seems to be incompatible with flex 2.5.4. That version of +flex places an int main function in the resulting scanner and there +doesn’t seem to be a way to stop it from mentioning it. The result is +that ccbuild will think that the generated scanner is a test program for +your class and won’t link it into the main program. A solution is to +move to a newer version of flex or find a way to remove the int main +function from the resulting scanner file.

REPORTING BUGS

-

Report any issue with ccbuild at: https://github.com/bneijt/ccbuild

+

Report any issue with ccbuild at: +https://github.com/bneijt/ccbuild

RESTRICTIONS

-

ccbuild will not follow or act on any include statements with a single space between the #-sign and the include. So all include statements starting with “# include” will be ignored, all other combinations will be acted on. This is a feature, not a bug. In verbose mode (–verbose) these are mentioned as warnings.

+

ccbuild will not follow or act on any include statements with a +single space between the #-sign and the include. So all include +statements starting with “# include” will be ignored, all other +combinations will be acted on. This is a feature, not a bug. In verbose +mode (–verbose) these are mentioned as warnings.

SEE ALSO

-

pkg-config(1), dotty(1), make(1), icmake(1), g++(1), aap(1), svn(1)

+

pkg-config(1), dotty(1), +make(1), icmake(1), g++(1), +aap(1), svn(1)

diff --git a/src/MD5Info/MD5Info.hh b/src/MD5Info/MD5Info.hh index 5c9854d..a78abdc 100644 --- a/src/MD5Info/MD5Info.hh +++ b/src/MD5Info/MD5Info.hh @@ -97,7 +97,7 @@ class MD5Info { MD5Info(); - ///\brief Destory the cache, saving any memory data to disk + ///\brief Destroy the cache, saving any memory data to disk ~MD5Info(); ///\brief Not implemented diff --git a/src/ccResolutions b/src/ccResolutions index f9f21dd..015f85d 100644 --- a/src/ccResolutions +++ b/src/ccResolutions @@ -1,4 +1,4 @@ -#& --args "-std=c++17 -p -Wall -Werror -pg -g -Wstrict-null-sentinel -Wformat -Wformat-security -Wwrite-strings -DVERSION=\\\"0.0.1-dev\\\" -fstack-protector --param=ssp-buffer-size=4" +#& --args "-std=c++23 -p -Wall -Werror -pg -g -Wstrict-null-sentinel -Wformat -Wformat-security -Wwrite-strings -DVERSION=\\\"0.0.1-dev\\\" -fstack-protector --param=ssp-buffer-size=4" #Left out -Wconversion and -pedantic because of the ugly yylex.cc # This file now requires ccbuild > 1.5.7 # Some options have no resolution, they should @@ -21,7 +21,7 @@ stddef.h boost/circular_buffer.hpp boost/lexical_cast.hpp openssl/evp.h `pkg-config --libs --cflags openssl` -bobcat/process -lbobcat +bobcat/process gnutls/crypto.h -lgnutls gnutls/gnutls.h -lgnutls boost/numeric/conversion/cast.hpp diff --git a/update_cmakelists.sh b/update_cmakelists.sh index 604d995..844a050 100755 --- a/update_cmakelists.sh +++ b/update_cmakelists.sh @@ -38,15 +38,18 @@ if [ -f "src/sourceScanner/yylex.cc" ]; then fi $CCBUILD md5 --recursive-include . "${PSOURCE}" > MD5SUMS -SOURCES=`egrep .cc$ MD5SUMS | sed -r 's/^[a-z0-9]+ //; s/ /\\ /' | tr '\n' ' '` +SOURCES=`grep -E .cc$ MD5SUMS | sed -r 's/^[a-z0-9]+ //; s/ /\\ /' | tr '\n' ' '` VERSION=$(git tag --points-at HEAD) +if [ -z "$VERSION" ]; then + VERSION=$(git describe --tags) +fi #Write CMakeLists.txt cat > CMakeLists.txt <