Files
mice-3ds/Makefile.linux
Mahyar Koshkouei ef0289bceb Refactor for testing
Added basic decoding functionality to test.

Refactored some code to stop 3DS specific code from compiling on
GNU/Linux.

Tested working by running the test executable on GNU/Linux. Vorbis
decoding has many errors detected by valgrind (but still decodes
successfully).
Opus, flac, and mp3 decoding work without errors.

Signed-off-by: Mahyar Koshkouei <mk@deltabeard.com>
2017-08-14 23:14:45 +01:00

66 lines
1.1 KiB
Makefile

# 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 \
file.h \
flac.h \
mp3.h \
opus.h \
vorbis.h \
wav.h
DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS))
_OBJ = file.o \
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)/*~