A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita
audio
rust
zig
deno
mpris
rockbox
mpd
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7#
8OPT_FLAGS=-O0
9
10INCLUDES = -I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) -I. $(TARGET_INC)
12CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN $(OPT_FLAGS) $(PROFILE_OPTS)
14
15ifdef APPEXTRA
16 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
17endif
18
19LINKFILE := $(OBJDIR)/link.lds
20DEPFILE = $(OBJDIR)/dep-lua
21
22# This sets up 'SRC' based on the files mentioned in SOURCES
23include $(TOOLSDIR)/makesrc.inc
24
25SOURCES = $(SRC)
26OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
27OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
28DIRS = .
29
30ifndef APP_TYPE
31 LDS := ../plugin.lds
32 OUTPUT = $(OUTDIR)/lua.rock
33else ## simulators
34 OUTPUT = $(OUTDIR)/lua.rock
35endif
36
37all: $(OUTPUT)
38
39ifndef APP_TYPE
40$(OBJDIR)/lua.elf: $(OBJS) $(LINKFILE)
41 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
42 -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/lua.map
43
44$(OUTPUT): $(OBJDIR)/lua.elf
45 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
46else
47
48ifdef APP_TYPE
49###################################################
50# This is the SDL simulator version
51
52$(OUTPUT): $(OBJS)
53 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_LDFLAGS) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
54ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
55# 'x' must be kept or you'll have "Win32 error 5"
56# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
57# #define ERROR_ACCESS_DENIED 5L
58else
59 @chmod -x $@
60endif
61
62endif
63endif # end of simulator section
64
65
66include $(TOOLSDIR)/make.inc
67
68# MEMORYSIZE should be passed on to this makefile with the chosen memory size
69# given in number of MB
70$(LINKFILE): $(LDS)
71 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
72 $(DEFINES) -E -P - >$@
73
74clean:
75 $(call PRINTS,cleaning lua)rm -rf $(OBJDIR)/lua
76 $(SILENT)rm -f $(OBJDIR)/lua.* $(DEPFILE)
77
78-include $(DEPFILE)
79