Skip to content

Commit

Permalink
Makefile: refactor/neutralize
Browse files Browse the repository at this point in the history
  • Loading branch information
Apaczer committed Sep 3, 2024
1 parent 3ad8bfe commit 499dec4
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 21 deletions.
66 changes: 54 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ alldir = burn \
generated \
sdl-dingux
#cpu/nec
incdir = $(foreach dir,$(alldir),-I$(srcdir)$(dir)) -I$(objdir)generated -I$(srcdir) -I/opt/miyoo/arm-miyoo-linux-uclibcgnueabi/sysroot/usr/include -I/opt/miyoo/arm-miyoo-linux-uclibcgnueabi/sysroot/usr/include/SDL
incdir = $(foreach dir,$(alldir),-I$(srcdir)$(dir)) -I$(objdir)generated -I$(srcdir)

lib = -lstdc++ -lSDL -lSDL_image -lz
lib = -lstdc++

ifdef USE_LIBAO
lib += -lao
Expand Down Expand Up @@ -254,19 +254,61 @@ alldep = $(foreach file,$(autobj:.o=.c), \

HOSTCC = gcc
HOSTCXX = g++
CC = /opt/miyoo/bin/arm-miyoo-linux-uclibcgnueabi-gcc
CXX = /opt/miyoo/bin/arm-miyoo-linux-uclibcgnueabi-g++
LD = $(CXX)
AS = /opt/miyoo/bin/arm-miyoo-linux-uclibcgnueabi-as

HOSTCFLAGS = $(incdir)
CFLAGS = -O2 -march=armv5te -mtune=arm926ej-s -pipe -fno-builtin -fno-common \
-fomit-frame-pointer -fexpensive-optimizations -Wno-write-strings -DLSB_FIRST
CXXFLAGS = -O2 -march=armv5te -mtune=arm926ej-s -pipe -fno-builtin -fno-common \
-fomit-frame-pointer -fexpensive-optimizations -Wno-write-strings -DLSB_FIRST

CHAINPREFIX ?= /opt/miyoo
CROSS_COMPILE ?= $(CHAINPREFIX)/usr/bin/arm-linux-
CC = $(CROSS_COMPILE)gcc
CXX = $(CROSS_COMPILE)g++
# `ld` fail with gcc platform cflags, use cc instead
LD = $(CC)
AS = $(CROSS_COMPILE)as

PKG_CONFIG ?= $(CHAINPREFIX)/usr/bin/pkg-config
PKGS = sdl SDL_image zlib
PKGS_CFLAGS = $(shell $(PKG_CONFIG) --cflags $(PKGS))
PKGS_LIBS = $(shell $(PKG_CONFIG) --libs $(PKGS))
# use custom -O2 flags (imported from GCC 9.5) to be less agressive
O2_OPT = -falign-functions -falign-jumps \
-falign-labels -falign-loops \
-fcaller-saves \
-fcode-hoisting \
-fcrossjumping \
-fcse-follow-jumps -fcse-skip-blocks \
-fdelete-null-pointer-checks \
-fdevirtualize -fdevirtualize-speculatively \
-fexpensive-optimizations \
-fgcse -fgcse-lm \
-fhoist-adjacent-loads \
-finline-small-functions \
-findirect-inlining \
-fipa-bit-cp -fipa-cp -fipa-icf \
-fipa-ra -fipa-sra -fipa-vrp \
-fisolate-erroneous-paths-dereference \
-flra-remat \
-foptimize-sibling-calls \
-foptimize-strlen \
-fpartial-inlining \
-fpeephole2 \
-freorder-blocks-algorithm=stc \
-freorder-functions \
-frerun-cse-after-loop \
-fschedule-insns -fschedule-insns2 \
-fsched-interblock -fsched-spec \
-fstore-merging \
-fstrict-aliasing \
-fthread-jumps \
-ftree-builtin-call-dce \
-ftree-pre \
-ftree-switch-conversion -ftree-tail-merge \
-ftree-vrp
CFLAGS = $(O2_OPT) -march=armv5te -mtune=arm926ej-s -pipe -fno-builtin -fno-common \
-fomit-frame-pointer -Wno-write-strings -DLSB_FIRST
CFLAGS += -D__cdecl="" -D__fastcall=""
CXXFLAGS += -D__cdecl="" -D__fastcall=""
CFLAGS += $(PKGS_CFLAGS)
CXXFLAGS = $(CFLAGS)

lib += $(PKGS_LIBS)

ifdef USE_LIBAO
CFLAGS += -DUSE_LIBAO
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## FBA - Final Burn Alpha SDL for MiyooCFW

### Cross-Compile build (MiyooCFW):
```
make -j$(nproc)
```

### Native build (linux):
```
no instructions yet
```
File renamed without changes.
6 changes: 0 additions & 6 deletions readme_miyoo.txt

This file was deleted.

3 changes: 0 additions & 3 deletions readmeagain.md

This file was deleted.

0 comments on commit 499dec4

Please sign in to comment.