Files
BBeOS/apps/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

177 lines
5.5 KiB
Makefile

# BBeOS Applications Makefile
# BlackBerry Classic Q20 Application Build System
CC = gcc
CFLAGS = -Wall -Wextra -std=c99 -O2 -g
LDFLAGS = -lm -ltermios
# Directories
APPS_DIR = .
CORE_DIR = $(APPS_DIR)/core
UTILITIES_DIR = $(APPS_DIR)/utilities
DEVELOPMENT_DIR = $(APPS_DIR)/development
BUILD_DIR = $(APPS_DIR)/build
# Core applications
CORE_APPS = calculator text-editor file-manager settings
CORE_SOURCES = $(CORE_DIR)/calculator.c $(CORE_DIR)/text-editor.c
# Utility applications
UTILITY_APPS = system-info network-tools backup-tool
UTILITY_SOURCES = $(UTILITIES_DIR)/system-info.c $(UTILITIES_DIR)/network-tools.c
# Development tools
DEV_APPS = debugger profiler
DEV_SOURCES = $(DEVELOPMENT_DIR)/debugger.c $(DEVELOPMENT_DIR)/profiler.c
# All applications
ALL_APPS = $(CORE_APPS) $(UTILITY_APPS) $(DEV_APPS)
# Default target
all: $(ALL_APPS)
# Core applications
calculator: $(CORE_DIR)/calculator.c
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
text-editor: $(CORE_DIR)/text-editor.c
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
file-manager: $(CORE_DIR)/file-manager.c
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
settings: $(CORE_DIR)/settings.c
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
# Utility applications
system-info: $(UTILITIES_DIR)/system-info.c
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
network-tools: $(UTILITIES_DIR)/network-tools.c
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
backup-tool: $(UTILITIES_DIR)/backup-tool.c
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
# Development tools
debugger: $(DEVELOPMENT_DIR)/debugger.c
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
profiler: $(DEVELOPMENT_DIR)/profiler.c
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
# Cross-compilation for ARM
arm-calculator: $(CORE_DIR)/calculator.c
arm-linux-gnueabihf-gcc $(CFLAGS) -o $@ $< $(LDFLAGS)
arm-text-editor: $(CORE_DIR)/text-editor.c
arm-linux-gnueabihf-gcc $(CFLAGS) -o $@ $< $(LDFLAGS)
arm-file-manager: $(CORE_DIR)/file-manager.c
arm-linux-gnueabihf-gcc $(CFLAGS) -o $@ $< $(LDFLAGS)
arm-settings: $(CORE_DIR)/settings.c
arm-linux-gnueabihf-gcc $(CFLAGS) -o $@ $< $(LDFLAGS)
arm-system-info: $(UTILITIES_DIR)/system-info.c
arm-linux-gnueabihf-gcc $(CFLAGS) -o $@ $< $(LDFLAGS)
arm-network-tools: $(UTILITIES_DIR)/network-tools.c
arm-linux-gnueabihf-gcc $(CFLAGS) -o $@ $< $(LDFLAGS)
arm-backup-tool: $(UTILITIES_DIR)/backup-tool.c
arm-linux-gnueabihf-gcc $(CFLAGS) -o $@ $< $(LDFLAGS)
arm-debugger: $(DEVELOPMENT_DIR)/debugger.c
arm-linux-gnueabihf-gcc $(CFLAGS) -o $@ $< $(LDFLAGS)
arm-profiler: $(DEVELOPMENT_DIR)/profiler.c
arm-linux-gnueabihf-gcc $(CFLAGS) -o $@ $< $(LDFLAGS)
# Build all ARM versions
arm-all: arm-calculator arm-text-editor arm-file-manager arm-settings \
arm-system-info arm-network-tools arm-backup-tool \
arm-debugger arm-profiler
# Create application packages
package: $(ALL_APPS)
mkdir -p $(BUILD_DIR)
tar -czf $(BUILD_DIR)/bbeos-apps-$(shell date +%Y%m%d).tar.gz $(ALL_APPS)
# Install applications
install: $(ALL_APPS)
install -d $(DESTDIR)/usr/bin
install -m 755 $(ALL_APPS) $(DESTDIR)/usr/bin/
# Install ARM versions
install-arm: arm-all
install -d $(DESTDIR)/usr/bin
install -m 755 arm-* $(DESTDIR)/usr/bin/
# Uninstall
uninstall:
rm -f $(DESTDIR)/usr/bin/calculator
rm -f $(DESTDIR)/usr/bin/text-editor
rm -f $(DESTDIR)/usr/bin/file-manager
rm -f $(DESTDIR)/usr/bin/settings
rm -f $(DESTDIR)/usr/bin/system-info
rm -f $(DESTDIR)/usr/bin/network-tools
rm -f $(DESTDIR)/usr/bin/backup-tool
rm -f $(DESTDIR)/usr/bin/debugger
rm -f $(DESTDIR)/usr/bin/profiler
# Clean
clean:
rm -f $(ALL_APPS)
rm -f arm-*
rm -f $(BUILD_DIR)/*.tar.gz
# Test applications
test: $(ALL_APPS)
@echo "Testing BBeOS applications..."
@echo "Calculator test:"
@echo "2+2" | ./calculator || echo "Calculator test failed"
@echo "Text editor test:"
@echo "test" | ./text-editor || echo "Text editor test failed"
@echo "All tests completed"
# 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")
@echo "Dependencies check passed"
# Help
help:
@echo "BBeOS Applications Makefile"
@echo "==========================="
@echo ""
@echo "Targets:"
@echo " all - Build all applications (default)"
@echo " calculator - Build calculator application"
@echo " text-editor - Build text editor application"
@echo " file-manager - Build file manager application"
@echo " settings - Build settings application"
@echo " system-info - Build system info utility"
@echo " network-tools - Build network tools utility"
@echo " backup-tool - Build backup tool utility"
@echo " debugger - Build debugger tool"
@echo " profiler - Build profiler tool"
@echo " arm-all - Build ARM cross-compiled versions"
@echo " package - Create application package"
@echo " install - Install applications to system"
@echo " install-arm - Install ARM versions"
@echo " uninstall - Remove installed applications"
@echo " clean - Remove build artifacts"
@echo " test - Run application tests"
@echo " check-deps - Check build dependencies"
@echo " help - Show this help"
@echo ""
@echo "Examples:"
@echo " make all # Build all applications"
@echo " make arm-all # Build ARM versions"
@echo " make install # Install to system"
@echo " make test # Run tests"
.PHONY: all clean install uninstall test check-deps help arm-all package install-arm