mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-22 02:38:11 +00:00
147 lines
3.6 KiB
Makefile
147 lines
3.6 KiB
Makefile
TARGET := retroarch_3ds
|
|
OBJS :=
|
|
OBJS += gfx/drivers/ctr_sprite.o griffin/griffin.o
|
|
#NO_SMDH = 1
|
|
DEBUG = 0
|
|
|
|
|
|
ifeq ($(strip $(DEVKITARM)),)
|
|
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
|
endif
|
|
|
|
ifeq ($(strip $(CTRULIB)),)
|
|
$(error "Please set CTRULIB in your environment. export CTRULIB=<path to>ctrulib")
|
|
endif
|
|
|
|
ifeq ($(strip $(AEMSTRO)),)
|
|
$(error "Please set AEMSTRO in your environment. export AEMSTRO=<path to>aemstro")
|
|
endif
|
|
|
|
INCDIRS := -I$(CTRULIB)/include
|
|
LIBDIRS := -L. -L$(CTRULIB)/lib
|
|
|
|
|
|
ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard
|
|
|
|
CFLAGS += -mword-relocations \
|
|
-fomit-frame-pointer -ffast-math \
|
|
$(ARCH)
|
|
|
|
#CFLAGS += -Wall
|
|
CFLAGS += -DARM11 -D_3DS
|
|
|
|
ifeq ($(DEBUG), 1)
|
|
CFLAGS += -O0 -g
|
|
else
|
|
CFLAGS += -O3
|
|
endif
|
|
CFLAGS += -I. -Ideps/zlib -Ideps/7zip -Ilibretro-common/include
|
|
|
|
CFLAGS += -DRARCH_INTERNAL -DRARCH_CONSOLE -DSINC_LOWEST_QUALITY
|
|
CFLAGS += -DHAVE_GRIFFIN=1 -DHAVE_FILTERS_BUILTIN -DHAVE_MENU -DHAVE_RGUI
|
|
CFLAGS += -DHAVE_ZLIB -DHAVE_RPNG -DWANT_ZLIB -DHAVE_BUILTIN_AUTOCONFIG
|
|
#-DHAVE_LIBRETRO_MANAGEMENT -DWANT_RPNG -DHAVE_7ZIP
|
|
|
|
|
|
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
|
|
|
|
ASFLAGS := -g $(ARCH)
|
|
LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
|
|
CFLAGS += -std=gnu99 -ffast-math
|
|
|
|
|
|
LIBS := -lretro_ctr -lctru -lm
|
|
|
|
|
|
|
|
.PHONY: $(BUILD) clean all
|
|
|
|
#---------------------------------------------------------------------------------
|
|
all: $(TARGET)
|
|
|
|
clean:
|
|
rm -f $(OBJS)
|
|
rm -f $(TARGET).3dsx
|
|
rm -f $(TARGET).elf
|
|
|
|
|
|
$(TARGET): $(TARGET).3dsx
|
|
$(TARGET).3dsx : $(TARGET).elf
|
|
$(TARGET).elf : $(OBJS)
|
|
|
|
ifeq ($(strip $(APP_TITLE)),)
|
|
APP_TITLE := $(notdir $(TARGET))
|
|
endif
|
|
|
|
ifeq ($(strip $(APP_DESCRIPTION)),)
|
|
APP_DESCRIPTION := Built with devkitARM & libctru
|
|
endif
|
|
|
|
ifeq ($(strip $(APP_AUTHOR)),)
|
|
APP_AUTHOR := Unspecified Author
|
|
endif
|
|
|
|
ifeq ($(strip $(APP_ICON)),)
|
|
APP_ICON := $(CTRULIB)/default_icon.png
|
|
endif
|
|
|
|
PREFIX := $(DEVKITARM)/bin/arm-none-eabi-
|
|
|
|
CC := $(PREFIX)gcc
|
|
CXX := $(PREFIX)g++
|
|
AS := $(PREFIX)as
|
|
AR := $(PREFIX)ar
|
|
OBJCOPY := $(PREFIX)objcopy
|
|
STRIP := $(PREFIX)strip
|
|
NM := $(PREFIX)nm
|
|
LD := $(CXX)
|
|
|
|
|
|
%.o: %.shader
|
|
#---------------------------------------------------------------------------------
|
|
@echo $(notdir $<)
|
|
python $(AEMSTRO)/aemstro_as.py $< $(notdir $<).shbin
|
|
bin2s $(notdir $<).shbin | $(PREFIX)as -o $@
|
|
echo "extern const u8" `(echo $(notdir $<).shbin | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(notdir $<).shbin | tr . _)`.h
|
|
echo "extern const u8" `(echo $(notdir $<).shbin | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(notdir $<).shbin | tr . _)`.h
|
|
echo "extern const u32" `(echo $(notdir $<).shbin | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> `(echo $(notdir $<).shbin | tr . _)`.h
|
|
rm $(notdir $<).shbin
|
|
|
|
|
|
%.o: %.cpp
|
|
$(CXX) -c -o $@ $< $(CXXFLAGS) $(INCDIRS)
|
|
|
|
%.o: %.c
|
|
$(CC) -c -o $@ $< $(CFLAGS) $(INCDIRS)
|
|
|
|
%.o: %.s
|
|
$(CC) -c -o $@ $< $(ASFLAGS)
|
|
|
|
%.o: %.S
|
|
$(CC) -c -o $@ $< $(ASFLAGS)
|
|
|
|
%.a:
|
|
$(AR) -rc $@ $^
|
|
|
|
%.vsh:
|
|
|
|
#---------------------------------------------------------------------------------
|
|
%.smdh: $(APP_ICON) $(MAKEFILE_LIST)
|
|
@echo building ... $(notdir $@)
|
|
smdhtool --create "$(APP_TITLE)" "$(APP_DESCRIPTION)" "$(APP_AUTHOR)" $(APP_ICON) $@
|
|
|
|
#---------------------------------------------------------------------------------
|
|
%.3dsx: %.elf
|
|
@echo building ... $(notdir $@)
|
|
3dsxtool $< $@ $(_3DSXFLAGS)
|
|
|
|
#---------------------------------------------------------------------------------
|
|
%.elf: .FORCE
|
|
@echo linking $(notdir $@)
|
|
$(LD) $(LDFLAGS) $(OBJS) $(LIBDIRS) $(LIBS) -o $@
|
|
$(NM) -CSn $@ > $(notdir $*.lst)
|
|
|
|
|
|
.PHONY: .FORCE
|
|
|