shithub: choc

Download patch

ref: 9f9d647297e57fd31f576ef41315266d6a27f94b
parent: 20d0f503988c23f34bfb8629451e7549b169d75f
author: Mike Swanson <mikeonthecomputer@gmail.com>
date: Tue Feb 21 15:57:48 EST 2017

Add midiproc to the automake system.

--- a/Makefile.am
+++ b/Makefile.am
@@ -70,7 +70,7 @@
 
 MAINTAINERCLEANFILES =  $(AUX_DIST_GEN)
 
-SUBDIRS=textscreen opl pcsound data src man
+SUBDIRS=textscreen midiproc opl pcsound data src man
 
 DIST_SUBDIRS=pkg $(SUBDIRS)
 
--- a/configure.ac
+++ b/configure.ac
@@ -151,6 +151,7 @@
 Makefile
 man/Makefile
 man/bash-completion/Makefile
+midiproc/Makefile
 opl/Makefile
 opl/examples/Makefile
 pcsound/Makefile
--- /dev/null
+++ b/midiproc/.gitignore
@@ -1,0 +1,6 @@
+Makefile.in
+Makefile
+*.exe
+.deps
+tags
+TAGS
--- /dev/null
+++ b/midiproc/Makefile.am
@@ -1,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
--- 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 @@
     reader->pos = dp + 1;
     return (char*)data_start;
 }
+
+#endif // #ifdef _WIN32
--- 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 @@
     return EXIT_SUCCESS;
 }
 
+#endif // #ifdef _WIN32
--- a/pkg/win32/GNUmakefile
+++ b/pkg/win32/GNUmakefile
@@ -43,14 +43,17 @@
 	./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 @@
 clean:
 	rm -f $(ZIPS)
 	rm -rf staging-*
-
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -68,6 +68,7 @@
 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                               \