# Part of JoeyLib, Copyright (c) 2026 Scott Duensing, under the MIT License. # See LICENSE.md for license information. # SPDX-License-Identifier: MIT # # Be API build rules: JoeyLib programs as Haiku programs, through the hosted # core and its Be API backend (src/hosted, src/hosted/be, C++). The rules are # make/hosted.mk's; this file says what the Be ports share, and # make/haiku.mk (x86_64, gcc 13) and make/haiku32.mk (32-bit x86, gcc 2.95: # the BeOS C++ ABI) what their compilers are. A project reaches them through # make/project.mk. # # A program is a Haiku executable NAME (no extension), in bin/ or in its own # bin/NAME/ with its DATA beside it: the port makes the executable's folder # the current directory when the window opens. Its icon (ID_ICON) is in its # resources, where Tracker and the Deskbar find it. Cross-compiled on this # machine; joey-run and the gates run it in a Haiku VM under QEMU. Each # includes common.mk, sets HOSTED_CC, HOSTED_CXX and HOSTED_AR, and # BE_CXX_RUNTIME (its C++ runtime library), then includes this file. HOSTED_BACKEND := be HOSTED_DEFINES := -DJOEYLIB_PLATFORM_HOSTED -DJOEYLIB_HOSTED_BE -DJOEYLIB_HOSTED_POSIX_SERIAL HOSTED_SDK_CFLAGS := # The Interface and Application Kits (libbe), the Media Kit's BSoundPlayer # (libmedia), the Device Kit's BJoystick (libdevice); the backend's C++ is # linked by the C compiler, so its runtime is named too. HOSTED_LINK := -lbe -lmedia -ldevice $(BE_CXX_RUNTIME) PROGRAM_EXT := # Its icons, the BeOS kind Haiku shows too: 32x32 and 16x16 in the BeOS # palette, raw (tools/iconBake.py be), put into the linked program's # resources by xres (component haikuTools) as BEOS:L:STD_ICON and # BEOS:M:STD_ICON, BE_ICON_ID each; and the 32x32 one as Haiku's vector # icon, BEOS:ICON, which Haiku draws at any size (BeOS R5 ignores it). An # icon too busy for one bakes an empty file and goes without. BE_XRES := $(HAIKU_TOOLS)/xres $(call requireTool,$(BE_XRES),toolchain:$(PLATFORM)) BE_ICON_ID := 101 HOSTED_ICON = $(call programIconDir,$(1))/icon32.raw BE_ICON_VECTOR = $(call programIconDir,$(1))/icon.hvif HOSTED_ICON_BAKE = $(ICON_BAKE) be $(call programIcon,$(1)) $(call HOSTED_ICON,$(1)) $(call programIconDir,$(1))/icon16.raw $(call BE_ICON_VECTOR,$(1)) HOSTED_PACK = $(BE_XRES) -o $(call programBin,$(1)) -a ICON:$(BE_ICON_ID):BEOS:L:STD_ICON $(call HOSTED_ICON,$(1)) -a MICN:$(BE_ICON_ID):BEOS:M:STD_ICON $(call programIconDir,$(1))/icon16.raw $$$$([ -s $(call BE_ICON_VECTOR,$(1)) ] && echo "-a VICN:$(BE_ICON_ID):BEOS:ICON $(call BE_ICON_VECTOR,$(1))") include $(REPO_DIR)/make/hosted.mk # UBER's probe build is part of JoeyLib's own `all` # (scripts/verify-be-display.sh). ifndef JOEY_PROJECT all $(PLATFORM): $(call programTarget,UBERPROB) endif