> ## Documentation Index
> Fetch the complete documentation index at: https://globaliptv.misidev.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Makefile targets

> Reference for every Make target in the GlobalTV Roku build system.

## Overview

The `Makefile` at the project root drives the entire build, sideload, and packaging workflow. All targets write output to the `out/` directory, which is created automatically and excluded from version control.

<CardGroup cols={2}>
  <Card title="make zip" icon="file-archive">
    Packages the channel into `out/GlobalTV.zip` — no device required.
  </Card>

  <Card title="make install" icon="upload">
    Sideloads the zip to a Roku in developer mode over the local network.
  </Card>

  <Card title="make pkg" icon="box">
    Produces a signed `.pkg` file ready for Channel Store submission.
  </Card>

  <Card title="make screenshot" icon="camera">
    Captures a full-HD screenshot of the running channel on the device.
  </Card>

  <Card title="make check" icon="circle-check">
    Runs all Roku 2026 certification pre-flight checks locally.
  </Card>

  <Card title="make clean" icon="trash">
    Deletes the `out/` directory and all build artifacts.
  </Card>

  <Card title="make help" icon="circle-question">
    Prints a usage summary with all targets and required variables.
  </Card>
</CardGroup>

***

## `make zip`

Packages the channel source into a zip archive that the Roku developer portal accepts.

| Detail                 | Value                               |
| ---------------------- | ----------------------------------- |
| **Output**             | `out/GlobalTV.zip`                  |
| **Required variables** | None                                |
| **Also runs**          | Creates `out/` if it does not exist |

The zip includes the directories listed in `ZIP_SOURCES`:

```text theme={null}
ZIP_SOURCES = manifest source components images
```

The following patterns are always excluded via `ZIP_EXCLUDE`:

```text theme={null}
*.git*  .env  .env.*  out/*  *.pkg  roku-deploy.json
Makefile  docs/*  *.md  *.zip  *.DS_Store  *Thumbs.db
*.xcf  *.psd
```

<Note>
  The Roku platform requires `manifest` to be at the **root** of the zip, not inside a subdirectory. The `zip` target handles this correctly.
</Note>

**Example**

```bash theme={null}
make zip
```

**Output**

```text theme={null}
>>> [zip] Empaquetando GlobalTV v1.0.6...
>>> [zip] OK → out/GlobalTV.zip
```

***

## `make install`

Sideloads the channel to a Roku device in developer mode. Internally runs `make zip` first, then POSTs the zip to `http://<ROKU_IP>/plugin_install`.

| Detail                 | Value                                                           |
| ---------------------- | --------------------------------------------------------------- |
| **Output**             | Channel installed on device; `out/_install_response.html` saved |
| **Required variables** | `ROKU_IP`, `ROKU_PASS`                                          |
| **Also runs**          | `make zip`                                                      |

| Variable    | Description                                               |
| ----------- | --------------------------------------------------------- |
| `ROKU_IP`   | Local IP address of the Roku device (e.g. `192.168.1.42`) |
| `ROKU_PASS` | Developer password set when enabling developer mode       |

**Example**

```bash theme={null}
make install ROKU_IP=192.168.1.42 ROKU_PASS=yourpassword
```

**Output**

```text theme={null}
>>> [install] Sideload en http://192.168.1.42...
>>> [install] HTTP 200
>>> [install] Resultado: Install Success
>>> [install] Listo. Revisar el Roku.
```

Possible result strings extracted from `_install_response.html`:

| Result            | Meaning                                                  |
| ----------------- | -------------------------------------------------------- |
| `Install Success` | Channel installed successfully                           |
| `Identical`       | The same zip was already installed; no change made       |
| `Install Failure` | Installation failed; check the HTML response for details |
| `Failed`          | Generic failure; usually a bad password or network issue |

***

## `make pkg`

Generates a signed `.pkg` file for submission to the Roku Channel Store. Internally sideloads the app first, then requests a signed package from the device via `http://<ROKU_IP>/plugin_package`.

| Detail                 | Value                                   |
| ---------------------- | --------------------------------------- |
| **Output**             | `out/GlobalTV-1.0.6.pkg`                |
| **Required variables** | `ROKU_IP`, `ROKU_PASS`, `SIGN_PASSWORD` |
| **Also runs**          | `make zip`, `make install`              |

| Variable        | Description                                                                |
| --------------- | -------------------------------------------------------------------------- |
| `ROKU_IP`       | Local IP address of the Roku device                                        |
| `ROKU_PASS`     | Developer password                                                         |
| `SIGN_PASSWORD` | Signing password generated by `genkey` (see [Packaging](/build/packaging)) |

**Example**

```bash theme={null}
make pkg ROKU_IP=192.168.1.42 ROKU_PASS=yourpassword SIGN_PASSWORD=abc123
```

**Output**

```text theme={null}
>>> [pkg] Instalando app para firmar...
>>> [pkg] Solicitando paquete firmado...
>>> [pkg] Descargando .pkg desde el Roku...

>>> [pkg] OK → out/GlobalTV-1.0.6.pkg
>>> [pkg] Listo para subir al Roku Channel Store.
```

***

## `make screenshot`

Captures a full-HD screenshot of the currently running sideloaded channel. The channel must be active on the device at the time of capture.

| Detail                 | Value                                |
| ---------------------- | ------------------------------------ |
| **Output**             | `out/screenshot-YYYYMMDD-HHMMSS.jpg` |
| **Required variables** | `ROKU_IP`, `ROKU_PASS`               |

**Example**

```bash theme={null}
make screenshot ROKU_IP=192.168.1.42 ROKU_PASS=yourpassword
```

**Output**

```text theme={null}
>>> [screenshot] Capturando pantalla del Roku...
>>> [screenshot] Guardado → out/screenshot-20260324-153045.jpg
```

***

## `make check`

Runs a series of local pre-flight checks against the source tree to verify Roku 2026 certification requirements. Does **not** require a device. Fails with a non-zero exit code if any check fails.

| Detail                 | Value                             |
| ---------------------- | --------------------------------- |
| **Output**             | Pass/fail lines printed to stdout |
| **Required variables** | None                              |

**Example**

```bash theme={null}
make check
```

**Checks performed**

*Manifest fields*

| Field                       | Purpose                                                          |
| --------------------------- | ---------------------------------------------------------------- |
| `title=`                    | Channel display name                                             |
| `major_version=`            | Semver major                                                     |
| `minor_version=`            | Semver minor                                                     |
| `build_version=`            | Build number (must increment on each submission)                 |
| `mm_icon_focus_hd=`         | HD home-screen icon                                              |
| `mm_icon_focus_fhd=`        | FHD home-screen icon                                             |
| `splash_screen_fhd=`        | FHD splash image                                                 |
| `splash_screen_hd=`         | HD splash image                                                  |
| `splash_screen_sd=`         | SD splash image                                                  |
| `ui_resolutions=fhd`        | Declares FHD support                                             |
| `rsg_version=1.2`           | Minimum SceneGraph version (note: manifest currently sets `1.3`) |
| `supports_input_launch=1`   | Enables deep link launch                                         |
| `splash_rsg_optimization=1` | Required for fast launch certification                           |
| `splash_color=`             | Background fill during splash                                    |
| `splash_min_time=`          | Minimum splash display time                                      |

*Image files*

| File                       | Purpose               |
| -------------------------- | --------------------- |
| `images/logo-hd.png`       | HD channel icon       |
| `images/logo-fhd.png`      | FHD channel icon      |
| `images/splash-fhd.png`    | FHD splash screen     |
| `images/splash-hd.png`     | HD splash screen      |
| `images/splash-sd.png`     | SD splash screen      |
| `images/globaltv-logo.png` | In-app branding asset |

*Code checks*

| Check                     | Rule                                  |
| ------------------------- | ------------------------------------- |
| No `eval()`               | Prohibited by Roku certification      |
| No `file://`              | All asset references must use `pkg:/` |
| No `bs_libs_required=v30` | Removed in Roku OS 11.5+              |

*Deep link checks (in `source/main.brs`)*

| Check                               | Rule                                    |
| ----------------------------------- | --------------------------------------- |
| `roInput` present                   | Required when `supports_input_launch=1` |
| `roInputEvent` handled              | Required for input deep links           |
| `launchDeepLink` or `inputDeepLink` | Deep link handling (checklist 8.1)      |

*Beacon check*

| Check                                                         | Rule                                   |
| ------------------------------------------------------------- | -------------------------------------- |
| `signalBeacon(AppLaunchComplete)` in `components/MainScreen/` | Required for launch time certification |

*OPTIONS key check*

| Check                                       | Rule                                                    |
| ------------------------------------------- | ------------------------------------------------------- |
| `options` not intercepted in `PlayerScreen` | Player must not capture the OPTIONS key (checklist 9.1) |

***

## `make clean`

Deletes the entire `out/` directory and all build artifacts inside it.

| Detail                 | Value          |
| ---------------------- | -------------- |
| **Output**             | `out/` removed |
| **Required variables** | None           |

**Example**

```bash theme={null}
make clean
```

**Output**

```text theme={null}
>>> [clean] out/ eliminado.
```

***

## `make help`

Prints a formatted usage summary to stdout. No side effects.

**Example**

```bash theme={null}
make help
```

**Output**

```text theme={null}
GlobalTV Roku — Makefile
════════════════════════════════════════════════════════

  make zip                               Crea out/GlobalTV.zip

  make install                           Sideload al Roku
       ROKU_IP=192.168.1.XX
       ROKU_PASS=xxxxxxxx

  make pkg                               Genera .pkg firmado para el Store
       ROKU_IP=192.168.1.XX
       ROKU_PASS=xxxxxxxx
       SIGN_PASSWORD=xxxx                (de: telnet <ip> 8080 → genkey)

  make screenshot                        Captura screenshot HD del Roku
       ROKU_IP=192.168.1.XX
       ROKU_PASS=xxxxxxxx

  make check                             Verifica certificación Roku 2026

  make clean                             Elimina out/
```
