LinuxCommandLibrary

sfdk-make

Build software packages using Salesforce DX

TLDR

Run make build

$ sfdk make
copy

Run make with extra arguments
$ sfdk make [arguments]
copy

SYNOPSIS

sfdk-make [options] [target]

PARAMETERS

-f file
    Specify the makefile to use. Defaults to 'Makefile' or 'makefile'.

-i
    Ignore all errors during execution.

-k
    Continue as much as possible after an error.

-n
    Print the commands that would be executed, but do not actually execute them.

-B
    Unconditionally make all targets.

-v
    Print version information.

-w
    Print the current working directory before and after executing commands.

target
    The target to build. If not specified, the first target in the makefile is built.

DESCRIPTION

The `sfdk-make` command is a build tool designed to streamline the development and deployment process for projects using the Salesforce Development Kit (SFDK). It simplifies the tasks of compiling source code, managing dependencies, running tests, and creating deployable packages. `sfdk-make` typically relies on a configuration file (often named `Makefile` or similar) to define the build steps and targets. This file specifies dependencies, compiler flags, and other build-related settings. By using `sfdk-make`, developers can automate repetitive build tasks, ensure consistent builds across different environments, and improve overall development efficiency. It works by parsing the specified configuration file, interpreting the defined rules, and executing the necessary commands to build the project. This command makes use of existing shell or operating system tools, such as `gcc`, `java`, or `ant`, in order to build the project.
The command is useful for any kind of SFDK project.

CAVEATS

The specific options and behavior of `sfdk-make` heavily depend on the underlying `make` implementation and the contents of the makefile used. Understanding the makefile syntax is crucial for effectively using this command.

MAKEFILE STRUCTURE

A Makefile generally contains rules defining how to build specific targets. Each rule has a target, dependencies, and a series of commands to execute. Understanding Makefile syntax is essential for using `sfdk-make`.

TROUBLESHOOTING

Common issues include syntax errors in the Makefile, missing dependencies, and incorrect compiler flags. Reading the error messages carefully and consulting the documentation for `make` and the SFDK are good starting points for troubleshooting.

SEE ALSO

make(1), gcc(1), ant(1)

Copied to clipboard