2017-05-04 01:22:28 +00:00
|
|
|
LOCAL_PATH := $(call my-dir)
|
|
|
|
|
2018-04-11 02:38:30 +00:00
|
|
|
CORE_DIR := $(LOCAL_PATH)/../..
|
2017-05-04 01:22:28 +00:00
|
|
|
|
2018-04-11 02:38:30 +00:00
|
|
|
CFLAGS :=
|
2017-05-04 01:22:28 +00:00
|
|
|
|
2018-04-11 02:38:30 +00:00
|
|
|
include $(CORE_DIR)/libretro/Makefile.common
|
2017-05-04 01:22:28 +00:00
|
|
|
|
2018-04-11 02:38:30 +00:00
|
|
|
GENERATED_SOURCES := $(filter %_boot.c,$(SOURCES_C))
|
2017-05-04 01:22:28 +00:00
|
|
|
|
2020-10-10 03:52:22 +00:00
|
|
|
COREFLAGS := -DINLINE=inline -D__LIBRETRO__ -DGB_INTERNAL $(INCFLAGS) -DSAMEBOY_CORE_VERSION=\"$(VERSION)\" -Wno-multichar -DANDROID
|
2017-05-04 01:22:28 +00:00
|
|
|
|
2018-04-11 02:38:30 +00:00
|
|
|
GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)"
|
|
|
|
ifneq ($(GIT_VERSION)," unknown")
|
|
|
|
COREFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
|
2017-05-04 01:22:28 +00:00
|
|
|
endif
|
|
|
|
|
2018-04-11 02:38:30 +00:00
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := retro
|
|
|
|
LOCAL_SRC_FILES := $(SOURCES_C)
|
|
|
|
LOCAL_CFLAGS := -std=c99 $(COREFLAGS) $(CFLAGS)
|
|
|
|
LOCAL_LDFLAGS := -Wl,-version-script=$(CORE_DIR)/libretro/link.T
|
2017-05-04 01:22:28 +00:00
|
|
|
include $(BUILD_SHARED_LIBRARY)
|
2018-02-04 02:14:31 +00:00
|
|
|
|
2018-02-20 17:57:33 +00:00
|
|
|
$(CORE_DIR)/libretro/%_boot.c: $(CORE_DIR)/build/bin/BootROMs/%_boot.bin
|
|
|
|
echo "/* AUTO-GENERATED */" > $@
|
|
|
|
echo "const unsigned char $(notdir $(@:%.c=%))[] = {" >> $@
|
|
|
|
hexdump -v -e '/1 "0x%02x, "' $< >> $@
|
|
|
|
echo "};" >> $@
|
|
|
|
echo "const unsigned $(notdir $(@:%.c=%))_length = sizeof($(notdir $(@:%.c=%)));" >> $@
|
|
|
|
|
2018-04-11 02:38:30 +00:00
|
|
|
.INTERMEDIATE: $(GENERATED_SOURCES)
|