diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 00000000..f70c72ee --- /dev/null +++ b/src/Makefile @@ -0,0 +1,34 @@ +CODING_OBJS=coding/adx_decoder.o \ + coding/g721_decoder.o \ + coding/ima_decoder.o \ + coding/ngc_afc_decoder.o \ + coding/ngc_dsp_decoder.o \ + coding/ngc_dtk_decoder.o \ + coding/pcm_decoder.o + +LAYOUT_OBJS=layout/ast_blocked.o \ + layout/blocked.o \ + layout/halpst_blocked.o \ + layout/interleave.o \ + layout/nolayout.o + +META_OBJS=meta/adx_header.o \ + meta/afc_header.o \ + meta/agsc.o \ + meta/ast.o \ + meta/brstm.o \ + meta/halpst.o \ + meta/nds_strm.o \ + meta/ngc_adpdtk.o \ + meta/rsf.o + +OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS) + +libvgmstream.a: $(OBJECTS) + $(AR) crsv libvgmstream.a $(OBJECTS) + +vgmstream-deps: + $(CC) $(CFLAGS) -M -o vgmstream-deps + +clean: + rm -f $(OBJECTS) libvgmstream.a diff --git a/test/Makefile b/test/Makefile index 97a87440..e72a9e54 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,14 +1,14 @@ -SHELL = /bin/sh -CFLAGS=-lm -Wall -O3 +export SHELL = /bin/sh +export CFLAGS=-Wall -O3 +export LDFLAGS=-lm -L../src -lvgmstream -VGMSTREAMFILES = ../src/streamfile.c ../src/vgmstream.c ../src/util.c ../src/meta/adx_header.c ../src/coding/adx_decoder.c ../src/coding/ngc_dsp_decoder.c ../src/meta/brstm.c ../src/layout/interleave.c ../src/layout/nolayout.c ../src/coding/pcm_decoder.c ../src/meta/nds_strm.c ../src/coding/ima_decoder.c ../src/meta/agsc.c ../src/meta/ngc_adpdtk.c ../src/coding/ngc_dtk_decoder.c ../src/coding/g721_decoder.c ../src/meta/rsf.c ../src/meta/afc_header.c ../src/coding/ngc_afc_decoder.c ../src/meta/ast.c ../src/layout/ast_blocked.c ../src/layout/halpst_blocked.c ../src/layout/blocked.c ../src/meta/halpst.c +.PHONY: libvgmstream.a -test: test.c $(VGMSTREAMFILES) - gcc $(CFLAGS) test.c $(VGMSTREAMFILES) -o test - strip test +test: libvgmstream.a + $(CC) $(CFLAGS) test.c $(LDFLAGS) -o test + +libvgmstream.a: + $(MAKE) -C ../src libvgmstream.a -test.exe: test.c $(VGMSTREAMFILES) - i586-mingw32msvc-gcc $(CFLAGS) test.c $(VGMSTREAMFILES) -o test.exe - i586-mingw32msvc-strip test.exe clean: - rm -f test test.exe + rm -f test diff --git a/test/Makefile.mingw b/test/Makefile.mingw new file mode 100644 index 00000000..c7d2da22 --- /dev/null +++ b/test/Makefile.mingw @@ -0,0 +1,16 @@ +export SHELL = /bin/sh +export CFLAGS=-Wall -O3 +export LDFLAGS=-lm -L../src -lvgmstream +export CC=i586-mingw32msvc-gcc +export AR=i586-mingw32msvc-ar + +.PHONY: libvgmstream.a + +test.exe: libvgmstream.a + $(CC) $(CFLAGS) test.c $(LDFLAGS) -o test.exe + +libvgmstream.a: + $(MAKE) -C ../src libvgmstream.a + +clean: + rm -f test.exe