joeylib2/make/common.mk
2026-06-30 18:07:12 -05:00

26 lines
1.2 KiB
Makefile

# Shared variables used by per-target Makefile fragments.
#
# Source this only via the per-target make file (make/iigs.mk etc).
REPO_DIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))/..)
INCLUDE_DIR := $(REPO_DIR)/include
# Machine-specific code lives in src/<machine>/ (iigs, amiga, atarist, dos);
# code shared across machines of one CPU lives in a processor folder (src/m68k).
SRC_DIR := $(REPO_DIR)/src
SRC_CORE := $(REPO_DIR)/src/core
SRC_CG := $(REPO_DIR)/src/codegen
SRC_68K := $(REPO_DIR)/src/m68k
EXAMPLES := $(REPO_DIR)/examples
# Portable C sources for libjoey -- present on every target.
CORE_C_SRCS := $(wildcard $(SRC_CORE)/*.c)
# Generic portable-C op defaults (the src/generic backend) -- present on every
# target. spriteEmitStub.c is excluded: it is the no-codegen template and
# redefines jlSpriteCompile / spriteCompiledDraw, which the real
# src/codegen/spriteCompile.c already provides.
GENERIC_C_SRCS := $(filter-out %/spriteEmitStub.c, $(wildcard $(SRC_DIR)/generic/*.c))
# Common include flags. Per-port code can include port.h / surfaceInternal.h
# directly because SRC_CORE is in the include path.
COMMON_CFLAGS := -I$(INCLUDE_DIR) -I$(SRC_CORE) -Wall -Wextra -Werror -O2