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# $Id$
8#
9
10# Shameless copy+paste from tools/ucl/src/Makefile
11# This is only used for rbutil builds, Rockbox uses microtar.make
12
13ifndef V
14SILENT = @
15endif
16
17ifeq ($(OS),Windows_NT)
18SHELL = cmd.exe
19mkdir = if not exist $(subst /,\,$(1)) mkdir $(subst /,\,$(1))
20else
21mkdir = mkdir -p $(1)
22endif
23
24ifdef RBARCH
25CFLAGS += -arch $(RBARCH)
26endif
27
28CPPDEFINES := $(shell echo foo | $(CROSS)$(CC) -dM -E -)
29#build standalone win32 executables on cygwin
30ifeq ($(findstring CYGWIN,$(CPPDEFINES)),CYGWIN)
31COMPILETARGET = cygwin
32else
33ifeq ($(findstring MINGW,$(CPPDEFINES)),MINGW)
34COMPILETARGET = mingw
35else
36# OS X specifics. Needs to consider cross compiling for Windows.
37ifeq ($(findstring APPLE,$(CPPDEFINES)),APPLE)
38# When building for 10.4+ we need to use gcc. Otherwise clang is used, so use
39# that to determine if we need to set arch and isysroot.
40ifeq ($(findstring __clang__,$(CPPDEFINES)),__clang__)
41CFLAGS += -mmacosx-version-min=10.5
42ifneq ($(ISYSROOT),)
43CFLAGS += -isysroot $(ISYSROOT)
44endif
45else
46# when building libs for OS X 10.4+ build for both i386 and ppc at the same time.
47# This creates fat objects, and ar can only create the archive but not operate
48# on it. As a result the ar call must NOT use the u (update) flag.
49ARCHFLAGS += -arch ppc -arch i386
50# building against SDK 10.4 is not compatible with gcc-4.2 (default on newer Xcode)
51# might need adjustment for older Xcode.
52CC = gcc-4.0
53CFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4
54NATIVECC ?= gcc-4.0
55endif
56COMPILETARGET = darwin
57else
58COMPILETARGET = posix
59endif
60endif
61endif
62$(info Compiler creates $(COMPILETARGET) binaries)
63
64TARGET_DIR ?= $(shell pwd)/
65OBJDIR = $(TARGET_DIR)build$(RBARCH)
66
67SOURCES = microtar.c microtar-stdio.c
68
69OBJS = $(addprefix $(OBJDIR)/,$(SOURCES:%.c=%.o))
70
71libmicrotar$(RBARCH).a: $(TARGET_DIR)libmicrotar$(RBARCH).a
72
73dll: microtar.dll
74microtar.dll: $(TARGET_DIR)microtar.dll
75$(TARGET_DIR)microtar.dll: $(OBJS)
76 @echo DLL $(notdir $@)
77 $(SILENT)$(CROSS)$(CC) $(CFLAGS) -shared -o $@ $^ \
78 -Wl,--output-def,$(TARGET_DIR)microtar.def
79
80$(TARGET_DIR)libmicrotar$(RBARCH).a: $(OBJS)
81 @echo AR $(notdir $@)
82 $(SILENT)$(CROSS)$(AR) rcs $@ $(OBJS)
83
84$(OBJDIR)/%.o: %.c
85 @echo CC $<
86 $(SILENT)$(call mkdir, $(dir $@))
87 $(SILENT)$(CROSS)$(CC) $(CFLAGS) $(ARCHFLAGS) -c $< -o $@
88
89clean:
90 rm -f $(TARGET_DIR)libmicrotar*.a
91 rm -rf build*