clang 24.0.0git
MakeSupport.h
Go to the documentation of this file.
1//===- MakeSupport.h - Make Utilities ---------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_CLANG_BASIC_MAKESUPPORT_H
10#define LLVM_CLANG_BASIC_MAKESUPPORT_H
11
12#include "clang/Basic/LLVM.h"
13#include "llvm/ADT/ArrayRef.h"
14#include "llvm/ADT/StringRef.h"
15
16namespace clang {
17
18/// Quote target names for inclusion in GNU Make dependency files.
19/// Only the characters '$', '#', ' ', '\t' are quoted.
20void quoteMakeTarget(StringRef Target, SmallVectorImpl<char> &Res);
21
22/// DependencyOutputFormat - Format for the compiler dependency file.
24
25/// Write Make-style dependency output to the output stream, in the form:
26/// target1 target2 ...: prereq1 prereq2 ...
27///
28/// \param Targets The targets, already quoted for Make via quoteMakeTarget().
29/// \param Files The prerequisites; each is escaped for \p Format when written.
30/// \param Format Escape prerequisites for GNU Make or NMake.
31/// \param PhonyTargets If true, also emit an empty "prereq:" line for each
32/// prerequisite (except \p InputFileIndex), so later deleting a prerequisite
33/// doesn't break the build.
34/// \param InputFileIndex Index in \p Files of the main input, skipped for
35/// phony target emission.
37 llvm::raw_ostream &OS, llvm::ArrayRef<std::string> Targets,
39 DependencyOutputFormat Format = DependencyOutputFormat::Make,
40 bool PhonyTargets = false, unsigned InputFileIndex = 0);
41
42} // namespace clang
43
44#endif // LLVM_CLANG_BASIC_MAKESUPPORT_H
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Top level wrappers for InstallAPI frontend operations.
void quoteMakeTarget(StringRef Target, SmallVectorImpl< char > &Res)
Quote target names for inclusion in GNU Make dependency files.
void printMakeDependencyFile(llvm::raw_ostream &OS, llvm::ArrayRef< std::string > Targets, llvm::ArrayRef< std::string > Files, DependencyOutputFormat Format=DependencyOutputFormat::Make, bool PhonyTargets=false, unsigned InputFileIndex=0)
Write Make-style dependency output to the output stream, in the form: target1 target2 ....
DependencyOutputFormat
DependencyOutputFormat - Format for the compiler dependency file.
Definition MakeSupport.h:23