2019-06-30 01:03:00 +00:00
|
|
|
ifeq ($(strip $(DEVKITARM)),)
|
|
|
|
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
|
|
|
endif
|
|
|
|
|
|
|
|
include $(DEVKITARM)/base_rules
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
|
2019-12-07 18:16:38 +00:00
|
|
|
NYX_LOAD_ADDR := 0x81000000
|
2019-06-30 01:03:00 +00:00
|
|
|
NYX_MAGIC := 0x43544347 #"GCTC"
|
2019-12-11 09:22:11 +00:00
|
|
|
include ./../Versions.inc
|
2019-06-30 01:03:00 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
TARGET := nyx
|
|
|
|
BUILDDIR := ./../build
|
|
|
|
OUTPUTDIR := ./../output
|
|
|
|
SOURCEDIR = nyx_gui
|
2020-06-14 13:45:45 +00:00
|
|
|
BDKDIR := bdk
|
|
|
|
BDKINC := -I../$(BDKDIR)
|
2020-03-03 23:34:35 +00:00
|
|
|
VPATH = $(dir $(wildcard ./$(SOURCEDIR)/)) $(dir $(wildcard ./$(SOURCEDIR)/*/)) $(dir $(wildcard ./$(SOURCEDIR)/*/*/))
|
2019-06-30 01:03:00 +00:00
|
|
|
VPATH += $(dir $(wildcard ./$(SOURCEDIR)/*/*/*/)) $(dir $(wildcard ./$(SOURCEDIR)/*/*/*/*/))
|
2020-06-16 09:41:42 +00:00
|
|
|
VPATH += $(dir $(wildcard ../$(BDKDIR)/)) $(dir $(wildcard ../$(BDKDIR)/*/)) $(dir $(wildcard ../$(BDKDIR)/*/*/)) $(dir $(wildcard ../$(BDKDIR)/*/*/*/))
|
2019-06-30 01:03:00 +00:00
|
|
|
|
|
|
|
# Main and graphics.
|
|
|
|
OBJS = $(addprefix $(BUILDDIR)/$(TARGET)/, \
|
2020-04-30 00:25:22 +00:00
|
|
|
start.o exception_handlers.o \
|
2019-06-30 01:03:00 +00:00
|
|
|
nyx.o heap.o \
|
|
|
|
gfx.o \
|
2020-04-30 13:12:55 +00:00
|
|
|
gui.o gui_info.o gui_tools.o gui_options.o gui_emmc_tools.o gui_emummc_tools.o gui_tools_partition_manager.o \
|
2019-06-30 01:03:00 +00:00
|
|
|
fe_emummc_tools.o fe_emmc_tools.o \
|
|
|
|
)
|
|
|
|
|
|
|
|
# Hardware.
|
|
|
|
OBJS += $(addprefix $(BUILDDIR)/$(TARGET)/, \
|
2020-07-17 21:42:53 +00:00
|
|
|
bpmp.o ccplex.o clock.o di.o gpio.o i2c.o irq.o pinmux.o pmc.o se.o smmu.o tsec.o uart.o \
|
2020-04-30 00:25:22 +00:00
|
|
|
fuse.o kfuse.o \
|
2020-04-30 11:58:53 +00:00
|
|
|
mc.o sdram.o minerva.o ramdisk.o \
|
2022-01-20 10:49:18 +00:00
|
|
|
sdmmc.o sdmmc_driver.o sd.o nx_emmc.o nx_emmc_bis.o \
|
2020-10-20 07:42:57 +00:00
|
|
|
bm92t36.o bq24193.o max17050.o max7762x.o max77620-rtc.o regulator_5v.o \
|
2020-04-30 10:16:30 +00:00
|
|
|
touch.o joycon.o tmp451.o fan.o \
|
2020-12-01 23:13:52 +00:00
|
|
|
usbd.o xusbd.o usb_descriptors.o usb_gadget_ums.o usb_gadget_hid.o \
|
2019-06-30 01:03:00 +00:00
|
|
|
hw_init.o \
|
|
|
|
)
|
|
|
|
|
|
|
|
# Utilities.
|
|
|
|
OBJS += $(addprefix $(BUILDDIR)/$(TARGET)/, \
|
|
|
|
btn.o dirlist.o ianos.o util.o \
|
|
|
|
config.o ini.o \
|
|
|
|
sprintf.o \
|
|
|
|
)
|
|
|
|
|
|
|
|
# Horizon.
|
|
|
|
OBJS += $(addprefix $(BUILDDIR)/$(TARGET)/, \
|
2021-08-28 15:10:20 +00:00
|
|
|
hos.o pkg1.o pkg2.o \
|
2019-06-30 01:03:00 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# Libraries.
|
|
|
|
OBJS += $(addprefix $(BUILDDIR)/$(TARGET)/, \
|
|
|
|
diskio.o ff.o ffunicode.o ffsystem.o \
|
2020-04-30 13:12:55 +00:00
|
|
|
elfload.o elfreloc_arm.o blz.o \
|
2019-06-30 01:03:00 +00:00
|
|
|
lv_group.o lv_indev.o lv_obj.o lv_refr.o lv_style.o lv_vdb.o \
|
|
|
|
lv_draw.o lv_draw_rbasic.o lv_draw_vbasic.o lv_draw_arc.o lv_draw_img.o \
|
|
|
|
lv_draw_label.o lv_draw_line.o lv_draw_rect.o lv_draw_triangle.o \
|
|
|
|
lv_hal_disp.o lv_hal_indev.o lv_hal_tick.o \
|
|
|
|
interui_20.o interui_30.o ubuntu_mono.o hekate_symbol_20.o hekate_symbol_30.o hekate_symbol_120.o lv_font_builtin.o \
|
|
|
|
lv_anim.o lv_area.o lv_circ.o lv_color.o lv_font.o lv_ll.o lv_math.o lv_mem.o lv_task.o lv_txt.o lv_gc.o \
|
2020-05-05 16:21:07 +00:00
|
|
|
lv_bar.o lv_btn.o lv_btnm.o lv_cb.o lv_cont.o lv_ddlist.o lv_img.o lv_label.o lv_line.o lv_list.o lv_lmeter.o lv_mbox.o \
|
2019-06-30 01:03:00 +00:00
|
|
|
lv_page.o lv_roller.o lv_slider.o lv_sw.o lv_tabview.o lv_ta.o lv_win.o lv_log.o lv_imgbtn.o \
|
|
|
|
lv_theme.o lv_theme_hekate.o \
|
|
|
|
)
|
|
|
|
|
2020-06-14 13:45:45 +00:00
|
|
|
GFX_INC := '"../nyx/$(SOURCEDIR)/gfx/gfx.h"'
|
|
|
|
FFCFG_INC := '"../nyx/$(SOURCEDIR)/libs/fatfs/ffconf.h"'
|
|
|
|
|
2019-06-30 01:03:00 +00:00
|
|
|
################################################################################
|
|
|
|
|
2020-06-13 15:39:17 +00:00
|
|
|
CUSTOMDEFINES := -DNYX_LOAD_ADDR=$(NYX_LOAD_ADDR) -DNYX_MAGIC=$(NYX_MAGIC)
|
2019-12-11 09:22:11 +00:00
|
|
|
CUSTOMDEFINES += -DNYX_VER_MJ=$(NYXVERSION_MAJOR) -DNYX_VER_MN=$(NYXVERSION_MINOR) -DNYX_VER_HF=$(NYXVERSION_HOTFX) -DNYX_RESERVED=$(NYXVERSION_RSVD)
|
2020-06-14 13:45:45 +00:00
|
|
|
CUSTOMDEFINES += -DNYX -DGFX_INC=$(GFX_INC) -DFFCFG_INC=$(FFCFG_INC)
|
2019-06-30 01:03:00 +00:00
|
|
|
|
|
|
|
#CUSTOMDEFINES += -DDEBUG
|
|
|
|
|
2020-12-11 16:14:00 +00:00
|
|
|
# UART Logging: Max baudrate 12.5M. Disables Joycon on Nyx if UARTB or UARTC.
|
|
|
|
# DEBUG_UART_PORT - 0: UART_A, 1: UART_B, 2: UART_C.
|
|
|
|
#CUSTOMDEFINES += -DDEBUG_UART_BAUDRATE=115200 -DDEBUG_UART_INVERT=0 -DDEBUG_UART_PORT=0
|
|
|
|
|
|
|
|
# LvGL UART LOG.
|
|
|
|
#CUSTOMDEFINES += -DDEBUG_UART_LV_LOG
|
|
|
|
|
2021-05-11 06:51:08 +00:00
|
|
|
#TODO: Considering reinstating some of these when pointer warnings have been fixed.
|
|
|
|
WARNINGS := -Wall -Wno-array-bounds -Wno-stringop-overread -Wno-stringop-overflow
|
|
|
|
|
2019-06-30 01:03:00 +00:00
|
|
|
ARCH := -march=armv4t -mtune=arm7tdmi -mthumb-interwork
|
2021-05-11 06:51:08 +00:00
|
|
|
CFLAGS = $(ARCH) -O2 -g -nostdlib -ffunction-sections -fdata-sections -fomit-frame-pointer -std=gnu11 $(WARNINGS) $(CUSTOMDEFINES)
|
2019-06-30 01:03:00 +00:00
|
|
|
LDFLAGS = $(ARCH) -nostartfiles -lgcc -Wl,--nmagic,--gc-sections -Xlinker --defsym=NYX_LOAD_ADDR=$(NYX_LOAD_ADDR)
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
.PHONY: all clean
|
|
|
|
|
|
|
|
all: $(TARGET).bin
|
2020-07-14 17:56:56 +00:00
|
|
|
@echo "--------------------------------------"
|
|
|
|
@echo -n "Nyx size: "
|
|
|
|
$(eval BIN_SIZE = $(shell wc -c < $(OUTPUTDIR)/$(TARGET).bin))
|
|
|
|
@echo $(BIN_SIZE)" Bytes"
|
|
|
|
@echo "--------------------------------------"
|
2019-06-30 01:03:00 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
@rm -rf $(OBJS)
|
|
|
|
@rm -rf $(BUILDDIR)
|
|
|
|
@rm -rf $(OUTPUTDIR)
|
|
|
|
|
|
|
|
$(TARGET).bin: $(BUILDDIR)/$(TARGET)/$(TARGET).elf
|
|
|
|
$(OBJCOPY) -S -O binary $< $(OUTPUTDIR)/$@
|
|
|
|
|
|
|
|
$(BUILDDIR)/$(TARGET)/$(TARGET).elf: $(OBJS)
|
2020-06-13 15:39:17 +00:00
|
|
|
@$(CC) $(LDFLAGS) -T $(SOURCEDIR)/link.ld $^ -o $@
|
|
|
|
@echo "Nyx was built with the following flags:\nCFLAGS: "$(CFLAGS)"\nLDFLAGS: "$(LDFLAGS)
|
2019-06-30 01:03:00 +00:00
|
|
|
|
|
|
|
$(BUILDDIR)/$(TARGET)/%.o: %.c
|
2020-06-13 15:39:17 +00:00
|
|
|
@echo Building $@
|
2020-06-14 13:45:45 +00:00
|
|
|
@$(CC) $(CFLAGS) $(BDKINC) -c $< -o $@
|
2019-06-30 01:03:00 +00:00
|
|
|
|
|
|
|
$(BUILDDIR)/$(TARGET)/%.o: %.S
|
2020-06-13 15:39:17 +00:00
|
|
|
@echo Building $@
|
|
|
|
@$(CC) $(CFLAGS) -c $< -o $@
|
2020-03-03 23:34:35 +00:00
|
|
|
|
|
|
|
$(OBJS): $(BUILDDIR)/$(TARGET)
|
|
|
|
|
|
|
|
$(BUILDDIR)/$(TARGET):
|
2019-06-30 01:03:00 +00:00
|
|
|
@mkdir -p "$(BUILDDIR)"
|
|
|
|
@mkdir -p "$(BUILDDIR)/$(TARGET)"
|
|
|
|
@mkdir -p "$(OUTPUTDIR)"
|