github.com/decred/dcrlnd@v0.7.6/docs/MAKEFILE.md (about)

     1  Makefile
     2  ========
     3  
     4  To build, verify, and install `dcrlnd` from source, use the following
     5  commands:
     6  ```
     7  make
     8  make check
     9  make install
    10  ```
    11  
    12  Developers
    13  ==========
    14  
    15  This document specifies all commands available from `dcrlnd`'s `Makefile`.
    16  The commands included handle:
    17  - Installation of all go-related dependencies.
    18  - Compilation and installation of `dcrlnd` and `dcrlncli`.
    19  - Compilation and installation of `dcrd` and `dcrctl`.
    20  - Running unit and integration suites.
    21  - Testing, debugging, and flake hunting.
    22  - Formatting and linting.
    23  
    24  Commands
    25  ========
    26  
    27  - [`all`](#scratch)
    28  - [`btcd`](#btcd)
    29  - [`build`](#build)
    30  - [`check`](#check)
    31  - [`clean`](#clean)
    32  - [`default`](#default)
    33  - [`dep`](#dep)
    34  - [`flake-unit`](#flake-unit)
    35  - [`flakehunter`](#flakehunter)
    36  - [`fmt`](#fmt)
    37  - [`install`](#install)
    38  - [`itest`](#itest)
    39  - [`lint`](#lint)
    40  - [`list`](#list)
    41  - [`rpc`](#rpc)
    42  - [`scratch`](#scratch)
    43  - [`travis`](#travis)
    44  - [`unit`](#unit)
    45  - [`unit-cover`](#unit-cover)
    46  - [`unit-race`](#unit-race)
    47  
    48  `all`
    49  -----
    50  Compiles, tests, and installs `lnd` and `lncli`. Equivalent to 
    51  [`scratch`](#scratch) [`check`](#check) [`install`](#install).
    52  
    53  `dcrd`
    54  ------
    55  Ensures that [`github.com/decred/dcrd`][dcrd] repository is checked out
    56  locally and installs the version of
    57  [`github.com/decred/dcrd`][dcrd] specified in `Gopkg.toml`
    58  
    59  `build`
    60  -------
    61  Compiles the current source and vendor trees, creating `./dcrlnd` and
    62  `./dcrlncli`.
    63  
    64  `check`
    65  -------
    66  Installs the version of [`github.com/decred/dcrd`][dcrd] specified
    67  in `Gopkg.toml`, then runs the unit tests followed by the integration
    68  tests.
    69  
    70  Related: [`unit`](#unit) [`itest`](#itest)
    71  
    72  `clean`
    73  -------
    74  Removes compiled versions of both `./dcrlnd` and `./dcrlncli`, and removes the
    75  `vendor` tree.
    76  
    77  `default`
    78  ---------
    79  Alias for [`scratch`](#scratch).
    80  
    81  `flake-unit`
    82  ------------
    83  Runs the unit test endlessly until a failure is detected.
    84  
    85  Arguments:
    86  - `pkg=<package>`
    87  - `case=<testcase>`
    88  - `timeout=<timeout>`
    89  
    90  Related: [`unit`](#unit)
    91  
    92  `flakehunter`
    93  -------------
    94  Runs the itegration test suite endlessly until a failure is detected.
    95  
    96  Arguments:
    97  - `icase=<itestcase>`
    98  - `timeout=<timeout>`
    99  
   100  Related: [`itest`](#itest)
   101  
   102  `fmt`
   103  -----
   104  Runs `go fmt` on the entire project. 
   105  
   106  `install`
   107  ---------
   108  Copies the compiled `dcrlnd` and `dcrlncli` binaries into `$GOPATH/bin`.
   109  
   110  `itest`
   111  -------
   112  Installs the version of [`github.com/decred/dcrd`][dcrd] specified in
   113  `Gopkg.toml`, builds the `./dcrlnd` and `./dcrlncli` binaries, then runs the
   114  integration test suite.
   115  
   116  Arguments:
   117  - `icase=<itestcase>` (the snake_case version of the testcase name field in the testCases slice (i.e. sweep_coins), not the test func name)
   118  - `timeout=<timeout>`
   119  
   120  `itest-parallel`
   121  ------
   122  Does the same as `itest` but splits the total set of tests into
   123  `NUM_ITEST_TRANCHES` tranches (currently set to 6 by default, can be overwritten
   124  by setting `tranches=Y`) and runs them in parallel.
   125  
   126  Arguments:
   127  - `icase=<itestcase>`: The snake_case version of the testcase name field in the
   128    testCases slice (i.e. `sweep_coins`, not the test func name) or any regular
   129    expression describing a set of tests.
   130  - `timeout=<timeout>`
   131  - `tranches=<number_of_tranches>`: The number of parts/tranches to split the
   132    total set of tests into.
   133  - `parallel=<number_of_threads>`: The number of threads to run in parallel. Must
   134    be greater or equal to `tranches`, otherwise undefined behavior is expected.
   135  
   136  `flakehunter-parallel`
   137  ------
   138  Runs the test specified by `icase` simultaneously `parallel` (default=6) times
   139  until an error occurs. Useful for hunting flakes.
   140  
   141  Example:
   142  ```shell
   143  $ make flakehunter-parallel icase='(data_loss_protection|channel_backup)' backend=neutrino
   144  ```
   145  
   146  `lint`
   147  ------
   148  Ensures that [`gopkg.in/alecthomas/gometalinter.v1`][gometalinter] is
   149  installed, then lints the project.
   150  
   151  `list`
   152  ------
   153  Lists all known make targets.
   154  
   155  `rpc`
   156  -----
   157  Compiles the `lnrpc` proto files.
   158  
   159  `scratch`
   160  ---------
   161  Compiles all dependencies and builds the `./dcrlnd` and `./dcrlncli` binaries.
   162  Equivalent to [`lint`](#lint) [`dep`](#dep) [`btcd`](#btcd)
   163  [`unit-race`](#unit-race).
   164  
   165  `unit`
   166  ------
   167  Runs the unit test suite. By default, this will run all known unit tests.
   168  
   169  Arguments:
   170  - `pkg=<package>` 
   171  - `case=<testcase>`
   172  - `timeout=<timeout>`
   173  - `log="stdlog[ <log-level>]"` prints logs to stdout
   174    - `<log-level>` can be `info` (default), `debug`, `trace`, `warn`, `error`, `critical`, or `off`
   175  
   176  `unit-cover`
   177  ------------
   178  Runs the unit test suite with test coverage, compiling the statistics in
   179  `profile.cov`.
   180  
   181  Arguments:
   182  - `pkg=<package>` 
   183  - `case=<testcase>`
   184  - `timeout=<timeout>`
   185  - `log="stdlog[ <log-level>]"` prints logs to stdout
   186    - `<log-level>` can be `info` (default), `debug`, `trace`, `warn`, `error`, `critical`, or `off`
   187  
   188  Related: [`unit`](#unit)
   189  
   190  `unit-race`
   191  -----------
   192  Runs the unit test suite with go's race detector.
   193  
   194  Arguments:
   195  - `pkg=<package>` 
   196  - `case=<testcase>`
   197  - `timeout=<timeout>`
   198  - `log="stdlog[ <log-level>]"` prints logs to stdout
   199    - `<log-level>` can be `info` (default), `debug`, `trace`, `warn`, `error`, `critical`, or `off`
   200  
   201  Related: [`unit`](#unit)
   202  
   203  [dcrd]: https://github.com/decred/dcrd (github.com/decred/dcrd")
   204  [gometalinter]: https://gopkg.in/alecthomas/gometalinter.v1 (gopkg.in/alecthomas/gometalinter.v1)