Makefile.inc

Overview

Makefile.inc is a build configuration file designed to automate the compilation process of Solidity-based smart contracts into their TVM (TON Virtual Machine) binary representations. It handles tasks such as copying necessary Solidity source files from a parent directory, compiling .sol files into .tvc and .abi.json artifacts, and cleaning up generated build files. This file uses GNU Make syntax for defining build targets, dependencies, and rules, streamlining contract development workflows in the project.

Variables and Their Purpose

Makefile Targets and Rules

clean

build

copy-files

build-contracts

Pattern Rule: ./%.tvc ./%.abi.json : ./%.sol

Implementation Details

Interaction with Other Parts of the System

Visual Diagram

flowchart TD
A["Start: make (default = build)"]
A --> B[copy-files]
B --> C{For each file in COPIED_FILES}
C -->|copy ../file.sol to ./file.sol| D[File copied]
D --> E[build-contracts]
E --> F{For each file in TVCS}
F -->|Compile file.sol| G[Run sold compiler]
G --> H[Generate file.tvc and file.abi.json]
H --> I[Remove debug.json and code files]
I --> J[Compilation success]
J --> K[Build complete]
A --> L["clean (manual)"]
L --> M[Remove generated files and import dirs]
M --> N[Clean complete]

This flowchart shows the main workflow: starting a build triggers copying files, then compiling contracts, generating artifacts, and optionally cleaning up generated files.