foxygit / doom Log in
commit 9f9d647297e57fd31f576ef41315266d6a27f94b
Author:     Mike Swanson <mikeonthecomputer@gmail.com>
AuthorDate: Tue Feb 21 20:57:48 2017 -0800
Commit:     Mike Swanson <mikeonthecomputer@gmail.com>
CommitDate: Wed Feb 22 22:49:57 2017 -0800

    Add midiproc to the automake system.
---
 Makefile.am           |  2 +-
 configure.ac          |  1 +
 midiproc/.gitignore   |  6 ++++++
 midiproc/Makefile.am  | 11 +++++++++++
 midiproc/buffer.c     |  4 ++++
 midiproc/main.c       |  3 +++
 pkg/win32/GNUmakefile |  8 +++++---
 src/Makefile.am       |  1 +
 8 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 74ee60c7..9c943a55 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -70,7 +70,7 @@ strifedocs_DATA = $(DOC_FILES) README.Strife.md

 MAINTAINERCLEANFILES =  $(AUX_DIST_GEN)

-SUBDIRS=textscreen opl pcsound data src man
+SUBDIRS=textscreen midiproc opl pcsound data src man

 DIST_SUBDIRS=pkg $(SUBDIRS)

diff --git a/configure.ac b/configure.ac
index bc6ba739..1f9c024f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -151,6 +151,7 @@ AC_OUTPUT([
 Makefile
 man/Makefile
 man/bash-completion/Makefile
+midiproc/Makefile
 opl/Makefile
 opl/examples/Makefile
 pcsound/Makefile
diff --git a/midiproc/.gitignore b/midiproc/.gitignore
new file mode 100644
index 00000000..fd891f37
--- /dev/null
+++ b/midiproc/.gitignore
@@ -0,0 +1,6 @@
+Makefile.in
+Makefile
+*.exe
+.deps
+tags
+TAGS
diff --git a/midiproc/Makefile.am b/midiproc/Makefile.am
new file mode 100644
index 00000000..c2ca9124
--- /dev/null
+++ b/midiproc/Makefile.am
@@ -0,0 +1,11 @@
+
+AM_CFLAGS=-I$(top_srcdir)/src @SDLMIXER_CFLAGS@
+
+if HAVE_WINDRES
+
+noinst_PROGRAMS = midiproc
+
+midiproc_LDADD = @SDLMIXER_LIBS@
+midiproc_SOURCES = buffer.c buffer.h main.c
+
+endif
diff --git a/midiproc/buffer.c b/midiproc/buffer.c
index 7ae97b5d..2b96b592 100644
--- a/midiproc/buffer.c
+++ b/midiproc/buffer.c
@@ -15,6 +15,8 @@
 //     A simple buffer and reader implementation.
 //

+#ifdef _WIN32
+
 #include "buffer.h"

 #include <stdlib.h>
@@ -243,3 +245,5 @@ char *Reader_ReadString(buffer_reader_t *reader)
     reader->pos = dp + 1;
     return (char*)data_start;
 }
+
+#endif // #ifdef _WIN32
diff --git a/midiproc/main.c b/midiproc/main.c
index c33022e7..ff199eb5 100644
--- a/midiproc/main.c
+++ b/midiproc/main.c
@@ -24,6 +24,8 @@
 // Seriously, how did they screw up something so fundamental?
 //

+#ifdef _WIN32
+
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <stdlib.h>
@@ -427,3 +429,4 @@ int main(int argc, char *argv[])
     return EXIT_SUCCESS;
 }

+#endif // #ifdef _WIN32
diff --git a/pkg/win32/GNUmakefile b/pkg/win32/GNUmakefile
index 484f0722..0659469b 100644
--- a/pkg/win32/GNUmakefile
+++ b/pkg/win32/GNUmakefile
@@ -43,14 +43,17 @@ staging-%:
 	./cp-with-libs --ldflags="$(LDFLAGS)" \
 	               $(TOPLEVEL)/src/$(PROGRAM_PREFIX)setup.exe \
 	               $@/$(PROGRAM_PREFIX)$*-setup.exe
+	./cp-with-libs --ldflags="$(LDFLAGS)" \
+	               $(TOPLEVEL)/midiproc/midiproc.exe \
+	               $@/midiproc.exe

 	$(STRIP) $@/*.exe $@/*.dll
-
+
 	for f in $(DOC_FILES); do                                \
 		cp $(TOPLEVEL)/$$f $@/$$(basename $$f .md).txt;  \
 	done
 	cp $(TOPLEVEL)/man/CMDLINE.$* $@/CMDLINE.txt
-
+
 	$(TOPLEVEL)/man/simplecpp -D_WIN32 -DPRECOMPILED  \
 	             -D$(shell echo $* | tr a-z A-Z)      \
 	         < $(TOPLEVEL)/man/INSTALL.template       \
@@ -59,4 +62,3 @@ staging-%:
 clean:
 	rm -f $(ZIPS)
 	rm -rf staging-*
-
diff --git a/src/Makefile.am b/src/Makefile.am
index ab691a21..2b9f8dd9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -68,6 +68,7 @@ i_endoom.c           i_endoom.h            \
 i_input.c            i_input.h             \
 i_joystick.c         i_joystick.h          \
                      i_swap.h              \
+i_midipipe.c         i_midipipe.h          \
 i_oplmusic.c                               \
 i_pcsound.c                                \
 i_sdlmusic.c                               \