Initial testing support

Added the ability to compile a subset of functions in to a test
executable for Linux. To be used in the future for testing.

Removed unnecessary includes.

Tested working by compiling test executable for GNU/Linux and for the
3DS. The 3dsx was tested in citra.

Signed-off-by: Mahyar Koshkouei <mk@deltabeard.com>
This commit is contained in:
Mahyar Koshkouei
2017-08-14 21:50:54 +01:00
parent 9a7d3683b9
commit 11d7bede77
10 changed files with 130 additions and 6 deletions

63
Makefile.linux Normal file
View File

@@ -0,0 +1,63 @@
# Makefile to produce test build of ctrmus for Linux
#
# make -f Makefile.linux
ifeq ($(OS),Windows_NT)
HOST_OS := windows
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
HOST_ARCH := x86_64
else
HOST_ARCH := i686
endif
else
UNAME_M := $(shell uname -m)
ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 amd64))
HOST_ARCH := x86_64
else ifeq ($(UNAME_M),$(filter $(UNAME_M),i386 i686))
HOST_ARCH := i686
else
$(error "Unsupported host architecture.")
endif
endif
IDIR =./source
CC=gcc
CFLAGS=-I./include/
LIBS=-lmpg123 -lvorbisidec -lopusfile -lopus -logg -lm
ODIR=./build/$(HOST_ARCH)
SDIR=./source
_DEPS = all.h \
flac.h \
mp3.h \
opus.h \
vorbis.h \
wav.h
DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS))
_OBJ = flac.o \
mp3.o \
opus.o \
test.o \
vorbis.o \
wav.o
OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))
all: directory test
directory:
mkdir -p $(ODIR)
$(ODIR)/%.o: $(SDIR)/%.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
test: $(OBJ)
gcc -o $@ $^ $(CFLAGS) $(LIBS)
.PHONY: clean directory
clean:
rm -f $(ODIR)/*.o *~ core $(INCDIR)/*~