depth = ../..
#
+# generic variables:
+#
+include ./$(depth)/make/Variables.make
+#
+
# identify module:
#
NAME = flower
build = ./$(depth)/flower/lib/.build
#
-# generic variables:
-#
-include ./$(depth)/make/Variables.make
-#
-
# descent order into subdirectories:
#
-SUBDIRS = include
+SUBDIRS = include
#
# to be remade each build:
# list of c++ header files:
#
-HHFILES = # $(shell ls include/*.hh)
+HHFILES = $(shell ls *.hh $(ERROR_LOG))
#
# list of c++ source files:
#
-CCFILES = $(shell ls *.cc)
+CCFILES = $(shell ls *.cc $(ERROR_LOG))
#
# list of other source files:
#
-EXTRA_SOURCE_FILES =# $(shell ls *.y *.l)
+EXTRA_SOURCE_FILES = $(shell ls *.y *.l $(ERROR_LOG))
#
# list of distribution files:
default: $(MAINTARGET)
#
-# sic.
-$(include-flower)/flower-config.hh:
- touch $@
+# # sic.
+# $(include-flower)/flower-config.hh:
+# touch $@
# generic targets and rules:
#
include ./$(depth)/make/Rules.make
#
+# list of depend files:
+#
+DEPFILES = $(shell ls $(depdir)/*.dep $(ERROR_LOG))
+#
+
# auto dependencies:
#
--include ./$(outdir)/*.dep
+-include $(DEPFILES)
#
depth = ..
#
+# generic variables:
+#
+include ./$(depth)/make/Variables.make
+#
+
# identify module:
#
NAME = lily
PATCH_LEVEL = $(TOPLEVEL_PATCH_LEVEL)
# use to send patches, always empty for released version:
MY_PATCH_LEVEL = $(TOPLEVEL_MY_PATCH_LEVEL)
-build = ./$(depth)/lily/.build
-#
-
-# generic variables:
-#
-include ./$(depth)/make/Variables.make
+build = $(lily-dir)/.build
#
# descent order into subdirectories:
# to be remade each build:
#
-VERSION_DEPENDENCY = $(lily-version)
+VERSION_DEPENDENCY =#
#
# list of c++ header files:
#
-HHFILES = # $(shell ls include/*.hh)
+HHFILES = $(shell ls *.hh $(ERROR_LOG))
#
# list of c++ source files:
#
-CCFILES = $(shell ls *.cc)
+CCFILES = $(shell ls *.cc $(ERROR_LOG))
#
# list of other source files:
#
-EXTRA_SOURCE_FILES = # $(shell ls *.y *.l)
+EXTRA_SOURCE_FILES = # $(shell ls *.y *.l $(ERROR_LOG))
#
# list of distribution files:
include ./$(depth)/make/Rules.make
#
+# list of depend files:
+#
+DEPFILES = $(shell ls $(depdir)/*.dep $(ERROR_LOG))
+#
+
# auto dependencies:
#
--include ./$(outdir)/*.dep
+-include $(DEPFILES)
#
depth = ..
#
+# generic variables:
+#
+include ./$(depth)/make/Variables.make
+#
+
# identify module:
#
NAME = lilypond
PATCH_LEVEL = $(TOPLEVEL_PATCH_LEVEL)
# use to send patches, always empty for released version:
MY_PATCH_LEVEL = $(TOPLEVEL_MY_PATCH_LEVEL)
-build = ./$(depth)/lily/.build
-#
-
-# generic variables:
-#
-include ./$(depth)/make/Variables.make
+build = $(lily-dir)/.build
#
# descent order into subdirectories:
# list of c++ header files:
#
-HHFILES = # $(shell ls include/*.hh)
+HHFILES = $(shell ls *.hh $(ERROR_LOG))
#
# list of c++ source files:
#
-CCFILES = $(shell ls *.cc)
+CCFILES = $(shell ls *.cc $(ERROR_LOG))
#
# list of other source files:
#
-EXTRA_SOURCE_FILES = $(shell ls *.y *.l)
+EXTRA_SOURCE_FILES = $(shell ls *.y *.l $(ERROR_LOG))
#
# list of distribution files:
lexer.l: $(outdir)/parser.hh
#
+# list of depend files:
+#
+DEPFILES = $(shell ls $(depdir)/*.dep $(ERROR_LOG))
+#
+
# auto dependencies:
#
--include ./$(outdir)/*.dep
+-include $(DEPFILES)
#
# ugh
# initdefault: $(CCDIR)/parser.cc $(CCDIR)/lexer.cc hdr/version.hh alldeps
-initdefault: check-flower-version $(lily-version) dummydep
+initdefault: check-flower-version $(lily-version) check-mi2mu-version dummydep
# $(MAKE) -C ./$(depth)/lily $(outdir)/parser.cc
-# ugh!
-dummydep:
- touch ./$(depth)/flower/lib/$(depdir)/dummy.dep
- touch ./$(depth)/lib/$(depdir)/dummy.dep
- touch ./$(depth)/lily/$(depdir)/dummy.dep
- touch ./$(depth)/m2m/$(depdir)/dummy.dep
-
-#$(DEPDIR)/%.dep: $(CCDIR)/%.cc
-# $(DODEP) $(CXX) -E $(CXXFLAGS) $^ > /dev/null
-
# generic targets and rules:
#
include ./$(depth)/make/Targets.make
# Jan Nieuwenhuizen <jan@digicash.com>
# Han-Wen Nienhuys <hanwen@stack.nl>
+# this is supposed to clear all suffixes:
.SUFFIXES:
+# so why does make still consider xx.y : RCS/xx.y,v ?
+# there is no suffix ,v anymore!
.SUFFIXES: .cc .o .hh .y .l .pod .txt .1 .dep
+# cancel implicit rules:
+#
+# shit, how to get rid of these stupid built-in rules?
+# include ./$(depth)/make/Builtin-rules.make
+#
+
# compile rules:
#
-$(outdir)/%.o: %.cc
+$(outdir)/%.o: %.cc $(genout)
$(DODEP)\
$(CXX) -c $(CXXFLAGS) $(CXX_OUTPUT_OPTION)
-$(outdir)/%.cc: %.y
+$(outdir)/%.cc: %.y $(genout)
# $(BISON) -d $<
$(BISON) $<
# mv $(shell basename $@ .cc ).tab.h $(include-lib)/$(shell basename $@ .cc).hh
# mv $(shell basename $@ .cc ).tab.h $(outdir)/$(shell basename $@ .cc).hh
mv $(shell basename $@ .cc ).tab.c $@
-$(outdir)/%.hh: %.y
+$(outdir)/%.hh: %.y $(genout)
$(BISON) -d $<
mv $(shell basename $@ .hh ).tab.h $@
mv $(shell basename $@ .hh ).tab.c $(outdir)/$(shell basename $@ .hh).cc
-$(outdir)/%.cc: %.l
+$(outdir)/%.cc: %.l $(genout)
$(FLEX) -t $< > $@
$(outdir)/%.text: $(outdir)/%.1
groff -man -Tascii $< > $@
-$(outdir)/%.1: %.pod
+$(outdir)/%.1: %.pod $(genout)
pod2man --center="LilyPond documentation" --section="0"\
--release="LilyPond $(MAJVER).$(MINVER).$(PATCHLEVEL)" $< > $@
#
+# outdirs:
+#
+# ?$(outdir)/%.dep:
+%.dep:
+ touch $@
+$(outdir):
+ mkdir $(outdir)
+ @touch $(genout)
+%/$(outdir):y
+ mkdir $@
+ @touch $(@D)/$(genout)
+$(genout):
+ mkdir $(outdir)
+ @touch $@
+%/$(genout):
+ mkdir $(@D)/$(outdir)
+ @touch $@
+#
+
+# build and config stuff: (could make this generic default rule...)
+#
+%/.build:
+ @echo 0 >$@
+$(flower-config): $(flower-dir)/$(genout)
+ touch $@
+$(lily-config): $(lib-dir)/$(genout)
+ @echo "#define LIBDIR \"./\"" >$@
+%.hh:
+ touch $@
+#
+
# specific stuff:
#
$(LIBFLOWER): check-flower-version
-# $(MAKE) -C ./$(depth)/flower/lib
$(MAKE) ./$(outdir)/$(@F) -C $(depth)/flower/lib
#
-$(LIBLILY): check-flower-version $(lily-version)
-# $(MAKE) -C ./$(depth)/lib
+$(LIBLILY):
$(MAKE) ./$(outdir)/$(@F) -C $(depth)/lib
#
# THIS IS A TEMPLATE FOR SUB-PROJECT MAKEFILES
# should we make Include-dir and Stuff-dir templates too?
-
+#
# project LilyPond -- the musical typesetter
# title makefile for ...
# file ../Makefile
depth = ..
#
+# generic variables:
+#
+include ./$(depth)/make/Variables.make
+#
+
# identify module:
#
NAME = ...
+MODULE_NAME =
# include ./$(depth)/$(NAME)/.version
MAJOR_VERSION = 0
MINOR_VERSION = 0
PATCH_LEVEL = 0
# use to send patches, always empty for released version:
MY_PATCH_LEVEL = # include separator: "-1" or ".a"
-build = ./$(depth)/lily/.build
-#
-
-# generic variables:
-#
-include ./$(depth)/make/Variables.make
+build = $(lily-dir)/.build
#
# descent order into subdirectories:
# list of c++ header files:
#
-HHFILES = $(shell ls *.hh)
+HHFILES = $(shell ls *.hh $(ERROR_LOG))
#
# list of c++ source files:
#
-CCFILES = $(shell ls *.cc)
+CCFILES = $(shell ls *.cc $(ERROR_LOG))
#
# list of other source files:
#
-EXTRA_SOURCE_FILES = $(shell ls *.y *.l)
+EXTRA_SOURCE_FILES = $(shell ls *.y *.l $(ERROR_LOG))
#
# list of distribution files:
#
-DISTFILES = $(HHFILES) $(CCFILES) $(EXTRA_SOURCE_FILES)
+DISTFILES = Makefile $(HHFILES) $(CCFILES) $(EXTRA_SOURCE_FILES)
#
# list of custom libraries:
include ./$(depth)/make/Rules.make
#
+# list of depend files:
+#
+DEPFILES = $(shell ls $(depdir)/*.dep $(ERROR_LOG))
+#
+
# auto dependencies:
#
-include ./$(outdir)/*.dep
+-include $(DEPFILES)
#
--- /dev/null
+#
+# project LilyPond -- the musical typesetter
+# title makefile for mi2mu
+# file mi2mu/Makefile
+#
+# Copyright (c) 1997 by
+# Jan Nieuwenhuizen <jan@digicash.com>
+# Han-Wen Nienhuys <hanwen@stack.nl>
+#
+
+# subdir level:
+#
+depth = ..
+#
+
+# generic variables:
+#
+include ./$(depth)/make/Variables.make
+#
+
+# identify module:
+#
+NAME = mi2mu
+MODULE_NAME = mi2mu
+include $(mi2mu-dir)/.version
+build = $(mi2mu-dir)/.build
+#
+
+# descent order into subdirectories:
+#
+SUBDIRS = include
+#
+
+# to be remade each build:
+#
+VERSION_DEPENDENCY = $(mi2mu-version)
+#
+
+# list of c++ header files:
+#
+HHFILES = $(shell ls *.hh $(ERROR_LOG))
+#
+
+# list of c++ source files:
+#
+CCFILES = $(shell ls *.cc $(ERROR_LOG))
+#
+
+# list of other source files:
+#
+EXTRA_SOURCE_FILES = $(shell ls *.y *.l $(ERROR_LOG))
+#
+
+# list of distribution files:
+#
+DISTFILES = Makefile .version $(HHFILES) $(CCFILES) $(EXTRA_SOURCE_FILES)
+#
+
+# list of custom libraries:
+#
+# yes, i know about the -L and -l options,
+# but these libraries get rebuild when needed.
+CUSTOMLIBES = $(LIBLILY) $(LIBFLOWER)
+
+LOADLIBES +=
+#
+
+# main target of this module:
+#
+# MAINTARGET = $(EXECUTABLE)
+# MAINTARGET = $(LIBRARY)
+MAINTARGET = $(bindir)/$(EXECUTABLE)# huh?
+# MAINTARGET = $(libdir)/$(LIBRARY)# huh?
+
+default: $(MAINTARGET)
+#
+
+# generic targets and rules:
+#
+include ./$(depth)/make/Targets.make
+include ./$(depth)/make/Rules.make
+#
+
+# explicit dependencies: (how to do auto?)
+#
+midi-lexer.l: $(outdir)/midi-parser.hh
+version.cc: check-flower-version $(mi2mu-version)
+#
+
+# version:
+#
+mi2mu-version: $(mi2mu-dir)/$(genout) $(mi2mu-version)
+$(mi2mu-version): $(mi2mu-dir)/$(genout) $(mi2mu-dir)/.version ./$(bindir)/make_version $(build)
+ ./$(bindir)/make_version "$(MAJOR_VERSION)" "$(MINOR_VERSION)" "$(PATCH_LEVEL)" "$(MY_PATCH_LEVEL)" "$(BUILD)" "$(CXX) $(CXXVER)" > $@
+#
+
+# list of depend files:
+#
+DEPFILES = $(shell ls $(depdir)/*.dep $(ERROR_LOG))
+#
+
+# auto dependencies:
+#
+-include $(DEPFILES)
+#
+
--- /dev/null
+//
+// main.cc -- implement silly main() entry point
+// should have Root class.
+//
+// copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
+
+#include "mi2mu.hh"
+
+Source source;
+Source* source_l_g = &source;
+
+Verbose level_ver = NORMAL_ver;
+
+// ugh
+bool no_triplets_bo_g = false;
+
+//ugh
+char const* defined_ch_c_l = 0;
+
+// ugh, another global
+String
+find_file( String str )
+{
+ return str;
+}
+
+// ugh, copied from warn.cc, cannot use
+void
+message( String message_str, char const* context_ch_c_l )
+{
+ String str = "mi2mu: ";
+ Source_file* sourcefile_l = source_l_g->sourcefile_l( context_ch_c_l );
+ if ( sourcefile_l ) {
+ str += sourcefile_l->file_line_no_str(context_ch_c_l) + String(": ");
+ }
+ str += message_str;
+ if ( sourcefile_l ) {
+ str += ":\n";
+ str += sourcefile_l->error_str( context_ch_c_l );
+ }
+// if ( busy_parsing() )
+ cerr << endl; // until we have fine output manager...
+ cerr << str << endl;
+}
+
+void
+warning( String message_str, char const* context_ch_c_l )
+{
+ message( "warning: " + message_str, context_ch_c_l );
+}
+
+void
+error( String message_str, char const* context_ch_c_l )
+{
+ message( message_str, context_ch_c_l );
+ // since when exits error again?
+ // i-d say: error: errorlevel |= 1; -> no output upon error
+ // warning: recovery -> output (possibly wrong)
+ if ( midi_lexer_l_g )
+ midi_lexer_l_g->errorlevel_i_ |= 1;
+}
+
+void
+help()
+{
+ btor <<
+ "--debug, -d be really verbose\n"
+ "--help, -h this help\n"
+ "--include=DIR, -I DIR add DIR to search path\n"
+ "--no-triplets, -n assume no triplets\n"
+ "--output=FILE, -o FILE set FILE as default output\n"
+ "--quiet, -q be quiet\n"
+ "--verbose, -v be verbose\n"
+ "--warranty, -w show warranty & copyright\n"
+ ;
+}
+
+void
+identify()
+{
+ mtor << version_str() << endl;
+}
+
+void
+notice()
+{
+ mtor <<
+ "\n"
+ "Mi2mu, translate midi to mudela.\n"
+ "Copyright (C) 1997 by\n"
+ " Han-Wen Nienhuys <hanwen@stack.nl>\n"
+// "Contributors\n"
+ " Jan Nieuwenhuizen <jan@digicash.com>\n"
+// " Mats Bengtsson <matsb@s3.kth.se>\n"
+ "\n"
+ " This program is free software; you can redistribute it and/or\n"
+ "modify it under the terms of the GNU General Public License version 2\n"
+ "as published by the Free Software Foundation.\n"
+ "\n"
+ " This program is distributed in the hope that it will be useful,\n"
+ "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+ "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n"
+ "General Public License for more details.\n"
+ "\n"
+ " You should have received a copy (refer to the file COPYING) of the\n"
+ "GNU General Public License along with this program; if not, write to\n"
+ "the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,\n"
+ "USA.\n";
+}
+
+int
+main( int argc_i, char* argv_sz_a[] )
+{
+ Long_option_init long_option_init_a[] = {
+ 0, "debug", 'd',
+ 0, "help", 'h',
+// 1, "include", 'I',
+ 0, "no-triplets", 'n',
+ 1, "output", 'o',
+ 0, "quiet", 'q',
+ 0, "verbose", 'v',
+ 0, "warranty", 'w',
+ 0,0,0
+ };
+ Getopt_long getopt_long( argc_i, argv_sz_a, long_option_init_a );
+ identify();
+
+ String output_str;
+ while ( Long_option_init* long_option_init_p = getopt_long() )
+ switch ( long_option_init_p->shortname ) {
+ case 'd':
+ level_ver = DEBUG_ver;
+ break;
+ case 'h':
+ help();
+ exit( 0 );
+ break;
+// case 'I':
+// path->push( getopt_long.optarg );
+// break;
+ case 'n':
+ no_triplets_bo_g = true;
+ break;
+ case 'o':
+ output_str = getopt_long.optarg;
+ break;
+ case 'q':
+ level_ver = QUIET_ver;
+ break;
+ case 'v':
+ level_ver = VERBOSE_ver;
+ break;
+ case 'w':
+ notice();
+ exit( 0 );
+ break;
+ default:
+ assert( 0 );
+ break;
+ }
+
+ char* arg_sz = 0;
+ while ( ( arg_sz = getopt_long.get_next_arg() ) ) {
+ My_midi_parser midi_parser( arg_sz );
+ int error_i = midi_parser.parse();
+ if ( error_i )
+ return error_i;
+ if ( !output_str.length_i() ) {
+ output_str = String( arg_sz ) + ".ly";
+ // i-m sure there-s already some routine for this
+ int name_i; // too bad we can-t declare local to if
+ if ( ( name_i = output_str.index_last_i( '/' ) ) != -1 )
+ output_str = output_str.mid_str( name_i + 1, INT_MAX );
+ }
+ error_i = midi_parser.output_mudela( output_str );
+ if ( error_i )
+ return error_i;
+ }
+ return 0;
+}
--- /dev/null
+//
+// template.cc -- implementemplate
+//
+// copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
+
+#include "proto.hh"
+#include "list.hh"
+#include "list.tcc"
+#include "cursor.tcc"
+
+L_instantiate(void *);
+
+class istream;
+class ostream;
+
+#include "mi2mu.hh"
+#include "plist.hh"
+#include "plist.tcc"
+
+IPL_instantiate(Midi_event);
+IPL_instantiate(Midi_track);
+PL_instantiate(Midi_voice);
+IPL_instantiate(Midi_voice);
+IPL_instantiate(Source_file);
+IPL_instantiate(Track_column);
+
--- /dev/null
+//
+// version.cc -- implement inexpensive versioning
+//
+// copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
+
+#include "mi2mu.hh"
+#include "fversion.hh"
+#include "version.hh"
+
+// should simply have Root class...
+String
+version_str()
+{
+ return String ( "This is mi2mu " ) + VERSIONSTR
+ + "/FlowerLib " + FVERSIONSTR
+ + " of " + __DATE__ + " " + __TIME__;
+}
+