Makefile.pandora
author Sam Lantinga
Sat, 08 Jun 2019 18:22:18 -0700
changeset 12803 70d338e248c8
parent 12131 9601849b3079
permissions -rw-r--r--
Fixed bug 4294 - Audio: perform more validation on conversion request

janisozaur

There are many cases which are not able to be handled by SDL's audio conversion routines, including too low (negative) rate, too high rate (impossible to allocate).

This patch aims to report such issues early and handle others in a graceful manner. The "INT32_MAX / RESAMPLER_SAMPLES_PER_ZERO_CROSSING" value is the conservative approach in terms of what can _technically_ be supported, but its value is 4'194'303, or just shy of 4.2MHz. I highly doubt any sane person would use such rates, especially in SDL2, so I would like to drive this limit further down, but would need some assistance to do that, as doing so would have to introduce an arbitrary value. Are you OK with such approach? What would a good value be? Wikipedia (https://en.wikipedia.org/wiki/High-resolution_audio) lists 96kHz as the highest sampling rate in use, even if I quadruple it for a good measure, to 384kHz it's still an order of magnitude lower than 4MHz.
slouken@3161
     1
# Makefile to build the pandora SDL library
slouken@3161
     2
slouken@3161
     3
AR	= arm-none-linux-gnueabi-ar
slouken@3161
     4
RANLIB	= arm-none-linux-gnueabi-ranlib
slouken@3161
     5
CC = arm-none-linux-gnueabi-gcc
slouken@3161
     6
CXX = arm-none-linux-gnueabi-g++
slouken@3161
     7
STRIP = arm-none-linux-gnueabi-strip
slouken@3161
     8
slouken@3161
     9
CFLAGS  = -O3 -march=armv7-a -mcpu=cortex-a8 -mtune=cortex-a8 -mfloat-abi=softfp \
slouken@3161
    10
	-mfpu=neon -ftree-vectorize -ffast-math -fomit-frame-pointer -fno-strict-aliasing -fsingle-precision-constant \
philipp@11108
    11
	-I./include -I$(PNDSDK)/usr/include
slouken@3161
    12
slouken@3161
    13
TARGET  = libSDL.a
slouken@3161
    14
slouken@12131
    15
SOURCES = 
slouken@12131
    16
	./src/*.c \
slouken@12131
    17
	./src/atomic/*.c \
slouken@12131
    18
	./src/audio/*.c \
slouken@12131
    19
	./src/audio/disk/*.c \
slouken@12131
    20
	./src/audio/dsp/*.c \
slouken@12131
    21
	./src/audio/dummy/*.c \
slouken@12131
    22
	./src/cpuinfo/*.c \
slouken@12131
    23
	./src/events/*.c \
slouken@12131
    24
	./src/file/*.c \
slouken@12131
    25
	./src/filesystem/unix/*.c \
slouken@12131
    26
	./src/haptic/*.c \
slouken@12131
    27
	./src/haptic/linux/*.c \
slouken@12131
    28
	./src/joystick/*.c \
slouken@12131
    29
	./src/joystick/linux/*.c \
slouken@12131
    30
	./src/loadso/dlopen/*.c \
slouken@12131
    31
	./src/power/*.c \
slouken@12131
    32
	./src/sensor/*.c \
slouken@12131
    33
	./src/sensor/dummy/*.c \
slouken@12131
    34
	./src/stdlib/*.c \
slouken@12131
    35
	./src/thread/*.c \
slouken@12131
    36
	./src/thread/pthread/SDL_syscond.c \
slouken@12131
    37
	./src/thread/pthread/SDL_sysmutex.c \
slouken@12131
    38
	./src/thread/pthread/SDL_syssem.c \
slouken@12131
    39
	./src/thread/pthread/SDL_systhread.c \
slouken@12131
    40
	./src/timer/*.c \
slouken@12131
    41
	./src/timer/unix/*.c \
slouken@12131
    42
	./src/video/*.c \
slouken@12131
    43
	./src/video/dummy/*.c \
slouken@12131
    44
	./src/video/pandora/SDL_pandora.o \
slouken@12131
    45
	./src/video/pandora/SDL_pandora_events.o \
slouken@12131
    46
	./src/video/x11/*.c \
slouken@3161
    47
	
slouken@3161
    48
slouken@3161
    49
OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')
slouken@3161
    50
philipp@11108
    51
CONFIG_H = $(shell cp include/SDL_config_pandora.h include/SDL_config.h)
slouken@3218
    52
slouken@3161
    53
all: $(TARGET)
slouken@3161
    54
slouken@3161
    55
$(TARGET): $(CONFIG_H) $(OBJECTS)
slouken@3161
    56
	$(AR) crv $@ $^
slouken@3161
    57
	$(RANLIB) $@
slouken@3161
    58
slouken@3161
    59
clean:
slouken@3161
    60
	rm -f $(TARGET) $(OBJECTS)