Files
BBeOS/packaging/Makefile
Eliott 7b53cde2ae
Some checks failed
CI / markdown-lint (push) Failing after 14s
Complete BBeOS project implementation with BlackBerry-inspired website
- Updated .gitignore with comprehensive exclusions for build artifacts, IDE files, and OS-specific files
- Created BlackBerry-inspired website with Heroicons and Gitea integration
- Added complete project structure with all 7 phases implemented
- Included kernel drivers, UI components, telephony stack, and packaging tools
- Added emulation scripts for testing and development
- Comprehensive documentation for all development phases
- Security analysis and hardware testing guides
- SDK and application framework for third-party development
2025-08-01 10:20:28 +02:00

116 lines
3.6 KiB
Makefile

# BBeOS Packaging System Makefile
# BlackBerry Classic Q20 System Packaging
CC = gcc
CFLAGS = -Wall -Wextra -std=c99 -O2 -g
LDFLAGS = -lz -lssl -lcrypto -lcurl
# Directories
PACKAGING_DIR = .
SYSTEM_DIR = $(PACKAGING_DIR)/system
SECURITY_DIR = $(PACKAGING_DIR)/security
UPDATES_DIR = $(PACKAGING_DIR)/updates
BACKUP_DIR = $(PACKAGING_DIR)/backup
# Targets
TARGETS = image-builder secure-boot ota-updater
# Source files
IMAGE_BUILDER_SRC = $(SYSTEM_DIR)/image-builder.c
SECURE_BOOT_SRC = $(SECURITY_DIR)/secure-boot.c
OTA_UPDATER_SRC = $(UPDATES_DIR)/ota-updater.c
# Object files
IMAGE_BUILDER_OBJ = $(SYSTEM_DIR)/image-builder.o
SECURE_BOOT_OBJ = $(SECURITY_DIR)/secure-boot.o
OTA_UPDATER_OBJ = $(UPDATES_DIR)/ota-updater.o
# Default target
all: $(TARGETS)
# System image builder
image-builder: $(IMAGE_BUILDER_OBJ)
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
$(IMAGE_BUILDER_OBJ): $(IMAGE_BUILDER_SRC)
$(CC) $(CFLAGS) -c -o $@ $<
# Secure boot tool
secure-boot: $(SECURE_BOOT_OBJ)
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
$(SECURE_BOOT_OBJ): $(SECURE_BOOT_SRC)
$(CC) $(CFLAGS) -c -o $@ $<
# OTA updater
ota-updater: $(OTA_UPDATER_OBJ)
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
$(OTA_UPDATER_OBJ): $(OTA_UPDATER_SRC)
$(CC) $(CFLAGS) -c -o $@ $<
# Cross-compilation for ARM
arm-image-builder: $(IMAGE_BUILDER_SRC)
arm-linux-gnueabihf-gcc $(CFLAGS) -o $@ $< $(LDFLAGS)
arm-secure-boot: $(SECURE_BOOT_SRC)
arm-linux-gnueabihf-gcc $(CFLAGS) -o $@ $< $(LDFLAGS)
arm-ota-updater: $(OTA_UPDATER_SRC)
arm-linux-gnueabihf-gcc $(CFLAGS) -o $@ $< $(LDFLAGS)
# Build all ARM targets
arm-all: arm-image-builder arm-secure-boot arm-ota-updater
# Clean
clean:
rm -f $(TARGETS) $(IMAGE_BUILDER_OBJ) $(SECURE_BOOT_OBJ) $(OTA_UPDATER_OBJ)
rm -f arm-image-builder arm-secure-boot arm-ota-updater
rm -f *.img *.pkg *.sig
# Install
install: all
install -d $(DESTDIR)/usr/bin
install -m 755 image-builder $(DESTDIR)/usr/bin/bbeos-image-builder
install -m 755 secure-boot $(DESTDIR)/usr/bin/bbeos-secure-boot
install -m 755 ota-updater $(DESTDIR)/usr/bin/bbeos-ota-updater
# Uninstall
uninstall:
rm -f $(DESTDIR)/usr/bin/bbeos-image-builder
rm -f $(DESTDIR)/usr/bin/bbeos-secure-boot
rm -f $(DESTDIR)/usr/bin/bbeos-ota-updater
# Dependencies check
check-deps:
@echo "Checking dependencies..."
@which gcc > /dev/null || (echo "Error: gcc not found" && exit 1)
@which arm-linux-gnueabihf-gcc > /dev/null || (echo "Warning: ARM cross-compiler not found")
@pkg-config --exists libssl || (echo "Error: OpenSSL development libraries not found" && exit 1)
@pkg-config --exists libcurl || (echo "Error: libcurl development libraries not found" && exit 1)
@echo "Dependencies check passed"
# Help
help:
@echo "BBeOS Packaging System Makefile"
@echo "==============================="
@echo ""
@echo "Targets:"
@echo " all - Build all tools (default)"
@echo " image-builder - Build system image builder"
@echo " secure-boot - Build secure boot tool"
@echo " ota-updater - Build OTA update tool"
@echo " arm-all - Build ARM cross-compiled versions"
@echo " clean - Remove build artifacts"
@echo " install - Install tools to system"
@echo " uninstall - Remove installed tools"
@echo " check-deps - Check build dependencies"
@echo " help - Show this help"
@echo ""
@echo "Examples:"
@echo " make all # Build all tools"
@echo " make arm-all # Build ARM versions"
@echo " make check-deps # Check dependencies"
@echo " make install # Install to system"
.PHONY: all clean install uninstall check-deps help arm-all