Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

Commit

Permalink
Added Classic Platform structure - ARMv7 Cortex A7 build (#252)
Browse files Browse the repository at this point in the history
* init commit

* Finished adding Armv7 CortexA7
  • Loading branch information
BananaRama203 authored and barbudreadmon committed Oct 22, 2018
1 parent bf50f42 commit 20daa80
Showing 1 changed file with 44 additions and 1 deletion.
45 changes: 44 additions & 1 deletion makefile.libretro
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ ifeq ($(platform),)
EXE_EXT=.exe
endif
else ifneq (,$(findstring armv,$(platform)))
override platform += unix
ifeq (,$(findstring classic_,$(platform)))
override platform += unix
endif
else ifneq (,$(findstring rpi,$(platform)))
override platform += unix
endif
Expand Down Expand Up @@ -254,6 +256,45 @@ else ifeq ($(platform), libnx)
STATIC_LINKING = 1
ENDIANNESS_DEFINES := -DLSB_FIRST

# Classic Platforms ####################
# Platform affix = classic_<ISA>_<µARCH>
# Help at https://modmyclassic.com/comp

# (armv7 a7, hard point, neon based) ###
# NESC, SNESC, C64 mini
else ifeq ($(platform), classic_armv7_a7)
TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC
SHARED := -shared -Wl,-no-undefined -Wl,--version-script=$(VERSION_SCRIPT)
CFLAGS += -Ofast \
-flto=4 -fwhole-program -fuse-linker-plugin \
-fdata-sections -ffunction-sections -Wl,--gc-sections \
-fno-stack-protector -fno-ident -fomit-frame-pointer \
-falign-functions=1 -falign-jumps=1 -falign-loops=1 \
-fno-unwind-tables -fno-asynchronous-unwind-tables -fno-unroll-loops \
-fmerge-all-constants -fno-math-errno \
-marm -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard
CXXFLAGS += $(CFLAGS)
CPPFLAGS += $(CFLAGS)
ASFLAGS += $(CFLAGS)
CXXFLAGS := -std=gnu++11
CFLAGS := -std=gnu11
HAVE_NEON = 1
ARCH = arm
BUILTIN_GPU = neon
USE_DYNAREC = 1
ENDIANNESS_DEFINES := -DLSB_FIRST
ifeq ($(shell echo `$(CC) -dumpversion` "< 4.9" | bc -l), 1)
CFLAGS += -march=armv7-a
else
CFLAGS += -march=armv7ve
# If gcc is 5.0 or later
ifeq ($(shell echo `$(CC) -dumpversion` ">= 5" | bc -l), 1)
LDFLAGS += -static-libgcc -static-libstdc++
endif
endif
#######################################

# Nintendo Game Cube / Wii / WiiU
else ifneq (,$(filter $(platform), ngc wii wiiu))
TARGET := $(TARGET_NAME)_libretro_$(platform).a
Expand Down Expand Up @@ -587,11 +628,13 @@ endif
$(CC) $(CFLAGS) $(INCFLAGS) -c $< -o $@

$(TARGET): $(OBJS)
@echo "** BUILDING $(TARGET) FOR PLATFORM $(platform) **"
ifeq ($(STATIC_LINKING), 1)
$(AR) rcs $@ $(OBJS)
else
$(LD) $(LINKOUT)$@ $(SHARED) $^ $(LDFLAGS) $(LIBS)
endif
@echo "** BUILD SUCCESSFUL! GG NO RE **"

clean-objs:
rm -f $(OBJS)
Expand Down

0 comments on commit 20daa80

Please sign in to comment.