The csmake Command Manual Page

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
EXAMPLES
SEE ALSO
AUTHOR

NAME

csmake - CScout make

SYNOPSIS

csmake [ [-d] [-h] [-k] [-o output-file] [-s cs-files-directory] [-A] [-T temporary-directory] [-t time-file] [-N rules-file] -- ] [make(1) options]

DESCRIPTION

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.

OPTIONS

-d

Run in debug mode (it also keeps spy directory in place).

-h

Print help message.

-k

Keep temporary directory in place.

-o output-file

Specify the name of the generated specification file, which is by default make.cs . A name of - will output the file on the standard output.

-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.

-t time-file

Record C compiler timing information in the specified file. The information recorded is the output of time(1) with format ’%D %e %F %I %K %M %O %S %U.

EXAMPLES

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 dpkg-buildpackage 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

SEE ALSO

cscout(1), cscut(1), cssplit(1).

AUTHOR

(C) Copyright 2006-2024 Diomidis Spinellis.