Skip to content

Instantly share code, notes, and snippets.

@DeadZay
DeadZay / make_intermediate.md
Created March 16, 2020 14:31 — forked from brabect1/make_intermediate.md
GNU Make and the effects of intermediate targets.

Intermediate files in make's terminology is a file needed somewhere on way from a source file to target file. An examples is a file.c needed to create file.o from file.y (YACC source). From that principle, an intermediate file is needed only once to generate the target after the source changed and thus can be removed after it was used. Therefore, an intermediate file which did not exist before make also does not exist after make (see [gnu_rule_chains]). In other words, make removes the intermediate files it needed to create (unless .SECONDARY or .PRECIOUS is used). For details refer to [gnu_rule_chains].

That being said, the use of explicit intermediate files (i.e. .INTERMEDIATE) is rarely needed. Often one either really wants to see the itermediate files too (thus making explicit targets and dependencies and remove

@DeadZay
DeadZay / ptarget.h
Created November 24, 2020 17:40 — forked from ByteProject/ptarget.h
header for compiler and OS detection (portable C)
/*
* ptarget.h
*
* Coded by Stefan Vogt, revised Feb 18, 2011.
* Released under the FreeBSD license.
* http://www.byteproject.net
*
* header for compiler and OS detection
*
*/