pandora_box 0.17.0

Syd's log inspector & profile writer
# pandora: syd helper to make sandboxing practical
# Makefile: Makefile for pandora
#
# Copyright (c) 2023, 2024, 2025 Ali Polatel <alip@chesswob.org>
#
# SPDX-License-Identifier: GPL-3.0

# Package name and version
PACKAGE= pandora
VERSION= 0.6.2

# Build profile
PROFILE?= release

# Installation directories
PREFIX= $(HOME)/.local
BIN_DIR = $(PREFIX)/bin

# Cargo and Installer
CARGO?= cargo
INSTALL?= install

# Cargo flags
CARGOFLAGS?= -j$(shell nproc)

# Source files
SRC=\
    pandora.rs \
    Cargo.toml

# Path to the binary
ifeq ($(PROFILE), debug)
	BIN= ./target/debug/$(PACKAGE)
else
	BIN= ./target/release/$(PACKAGE)
	CARGOFLAGS+= --release
endif

# Default target
all: $(BIN)

# QA targets
fmt:
	$(CARGO) fmt
lint:
	$(CARGO) deny check
	$(CARGO) acl -n || true
	$(CARGO) clippy $(CARGOFLAGS)

# Install and Uninstall Targets
install: $(BIN)
	$(INSTALL) -d $(BIN_DIR)
	$(INSTALL) -m 755 $(BIN) $(BIN_DIR)
uninstall:
	rm -f $(BIN_DIR)/$(PACKAGE)

# Check target
check: test

test: $(BIN)
	$(CARGO) test $(CARGOFLAGS)

# Clean Target
clean:
	$(CARGO) clean

$(BIN): $(SRC)
	$(CARGO) build $(CARGOFLAGS)

# Phony Targets
.PHONY: all clean check test install uninstall fmt lint