csmake - CScout make
csmake [ [-d] [-h] [-k] [-s cs_files_directory] [-A] [-T temporary_directory] [-N rules_file] -- ] [make(1) options]
csmake is a wrapper around make and typical C compilation commands. When invoked instead of make on a clean (unbuilt) system, it will build the system in the same way as make. As a side-effect it will monitor the invocations of cc(1), gcc(1), clang(1), ar(1), ld(1), and mv(1) commands and record their environment and arguments. With those data it will generate a CScout project specification that can be used to process the project that was compiled. The project specification is saved into a file named make.cs. Moreover, a separate CScout .cs file can be generated for each executable in a specified cs_files_directory.
To allow csmake to be used as a drop in replacement in build sequences that execute multiple make commands, you can create a /tmp/csmake-spy, which will be used to create rules for the superset of all make-generated executables.
csmake options can be passed through CSMAKEFLAGS environment variable.
-d |
Run debug mode (it also keeps spy directory in place). |
|||
-h |
Prints help message. |
|||
-k |
Keep temporary directory in place. |
-s cs_files_directory
Create a separate CScout .cs file for each real executable. Save the .cs files into cs_files_directory in the current directory.
-A |
Generate cs projects for static libraries. |
-N rules_file
Run on an existing rules file.
-T temporary_directory
Set temporary directory. Use temporary_directory as temporary directory, remember to clear it if you use it multiple times.
The following commands are often the only ones required to process a typical C project.
make clean csmake cscout make.cs
If you want to use csmake with another C compiler, prepend CC=compiler-name to the csmake invocation, as shown in the following example.
CC=x86_64-w64-gcc csmake
The following commands create an inspectable rules file, and then use that to creat the final make.cs file. (Note the obligatory -- sequence used to terminate the csmake arguments.)
mkdir csmake-tmp csmake -k -T csmake-tmp -- csmake -N csmake-tmp/rules --
The following commands can be used to run csmake for a Debian package using the command.
rm -rf tmp_dir && mkdir -p tmp_dir CSMAKEFLAGS=’-T tmp_dir -A -s cscout_projects -k --’ \ MAKE=/usr/local/bin/csmake dpkg-buildpackage -b
cscout(1)
(C) Copyright 2006-2024 Diomidis Spinellis.