ps2rom/build/core.mk

37 lines
771 B
Makefile
Raw Normal View History

2023-11-06 02:07:09 -05:00
# Common GNU Make rules for building targets (reducing boilerplate)
# This makefile is expected to be included after the variables given
2023-11-06 02:07:09 -05:00
# *have* been defined:
#
# NAME=name
#
# TARGET=ee|iop
#
# KIND=bin|lib
#
# SRCS=[... source-file-list]
#
debug_Valid := y
release_Valid := y
ifneq ($($(CONFIG)_Valid),y)
$(error Invalid configuration $(CONFIG) specified)
endif
BINDIR = $(TOP)/bin
OBJDIR = obj/$(CONFIG)
FINALNAME=$(NAME)_$(CONFIG)
OBJECTS := $(patsubst %.c,obj/$(CONFIG)/%.o,$(filter %.c,$(SRCS)))
OBJECTS += $(patsubst %.cpp,obj/$(CONFIG)/%.o,$(filter %.cpp,$(SRCS)))
OBJECTS += $(patsubst %.s,obj/$(CONFIG)/%.o,$(filter %.s,$(SRCS)))
# include target-specific recipies specifying how to
# build for the target.
include $(TOP)/build/targets/$(TARGET).mk