2023-11-06 02:07:09 -05:00
|
|
|
# Common GNU Make rules for building targets (reducing boilerplate)
|
2023-11-02 03:57:19 -04:00
|
|
|
|
|
|
|
# This makefile is expected to be included after the variables given
|
2023-11-06 02:07:09 -05:00
|
|
|
# *have* been defined:
|
2023-11-02 03:57:19 -04:00
|
|
|
#
|
|
|
|
# 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)))
|
|
|
|
|
2023-11-06 06:36:49 -05:00
|
|
|
CFLAGS := $(CFLAGS) $(INCS)
|
|
|
|
|
2023-11-06 01:56:09 -05:00
|
|
|
# include target-specific recipies specifying how to
|
|
|
|
# build for the target.
|
|
|
|
include $(TOP)/build/targets/$(TARGET).mk
|
|
|
|
|
|
|
|
|