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:
63
Makefile.linux
Normal file
63
Makefile.linux
Normal 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)/*~
|
||||
Reference in New Issue
Block a user