]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.39
authorfred <fred>
Sun, 24 Mar 2002 19:34:26 +0000 (19:34 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:34:26 +0000 (19:34 +0000)
14 files changed:
.version [new file with mode: 0644]
INSTALL [new file with mode: 0644]
NEWS
TODO
flower/.version
flower/NEWS
flower/lib/Makefile
lib/include/windhoos-suck-suck-suck-thank-you-cygnus.hh [new file with mode: 0644]
lib/source-file.cc [new file with mode: 0644]
lib/windhoos-suck-suck-suck-thank-you-cygnus.cc [new file with mode: 0644]
make/Targets.make [new file with mode: 0644]
make/Template.make [new file with mode: 0644]
make/User.make [new file with mode: 0644]
make/Variables.make [new file with mode: 0644]

diff --git a/.version b/.version
new file mode 100644 (file)
index 0000000..22587f3
--- /dev/null
+++ b/.version
@@ -0,0 +1,6 @@
+TOPLEVEL_MAJOR_VERSION = 0
+TOPLEVEL_MINOR_VERSION = 0
+TOPLEVEL_PATCH_LEVEL = 39
+# use to send patches, always empty for released version:
+TOPLEVEL_MY_PATCH_LEVEL = -1# include separator: "-1" or ".a"
+#
diff --git a/INSTALL b/INSTALL
new file mode 100644 (file)
index 0000000..29161e6
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,50 @@
+IMPORTANT:
+
+    if you have downloaded a
+
+           *.pre*
+
+    version, then this is version is *not* meant for producing nice output
+    (but to keep your patchsets up to date).  It might not even compile.
+
+
+INSTALL:
+
+    to make LilyPond, simply type:
+
+           sh configure
+           make           
+           
+    assuming you have the gnu development tools, and your make is gnu make, 
+    else try something like:
+    
+           MAKE=gmake configure
+           MAKE=gmake gmake
+
+    \begin{masochist}
+    Windows NT:
+
+    you need the cygnus win32 gnu port development stuff; have a look
+    at http://www.cygnus.com/gnu-win32.
+
+    to make LilyPond under, brr, aargh, well, simply type:
+
+           bash bin/configure
+           make win32
+    \end{masochist}
+
+
+SUPPORT
+
+    LilyPond (pl 0.0.39) is known to compile on the following platforms:
+
+       * linux 2.0.28, g++ 2.7.2[.1]
+       * aix 4.1, g++ 2.7.2
+       * windows-nt 4.0, cygnus gnu-win32 beta17.1 (~=g++ 2.7.2)
+       * linux 2.0.28 X to doze, gcc-go32 (~=g++ 2.7.2)
+
+Have fun!
+
+    hanwen@stack.nl
+    jan@digicash.com
+
diff --git a/NEWS b/NEWS
index 130c3b96561aa337db163d28a7f46b53428c824f..4441132305c8caec69a5c60fbd6836b65cf9d0e4 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,40 @@
+pl 39-1
+       - doze target (for 16 bit dos xcompiler: gcc-go32)
+Internal
+       - make/User.make; C..FLAGS sorted out
+Bugfix
+       - make clean...
+
+pl 39
+       - new make structure, featuring:
+           * top-level/sub-level build
+           * auto custom-library dependencies/build
+           * top-level/sub-level dist
+           * minimal(? can even smaller) specific Makefiles
+           * which makes for simple lib/exe module split (make/Template.make)
+           * integrated flowerlib
+           * all stuff into subbirs (make/Stuff.make)
+           * all headers into <module>/include dirs (make/Include.make)
+           * all output into <module>/out (executables into bin/)
+           * more make features, like make config, make help
+           * small lily lib
+           * lilypond-x.x.x/.version for toplevel lily version
+           * lilypond-x.x.x/<module>/.version for <module> version (eg: flower)
+           * versioning using additional optional MY_PATCH_LEVEL 
+               for easy make_patch
+
+       - bin/cptogen
+
+Internal
+       - generic m2m header: m2m.hh
+
+Bugfix
+       - small fixes, make, dist, configure
+
+pl 38-5
+       - all of the below, e.g. new filenames and new makefile 
+         structure patches merged
+
 pl 38
 
 Internal
@@ -7,6 +44,19 @@ Internal
 intrinsically hierarchical. All walker communication is done via a
 "top level" register.
 
+pl 37-3
+       - m2m handles voices
+       - instrument, track_name, copyright/left stuff for m2m/ly
+
+Internal
+       - Midi_voice
+
+pl 37-1
+       - text, key, tempo event in midi output/ly input
+
+Internal
+       - simple makefile structure, allows for multiple projects
+
 ******
 pl 37
 
diff --git a/TODO b/TODO
index e9824ff75600fe0aa61a0399edc69634271e8f1d..87d3ef806cf8f4ebb9a3d4b23849d3a98421d3c6 100644 (file)
--- a/TODO
+++ b/TODO
@@ -17,6 +17,13 @@ before 0.1
 This is an assorted collection of stuff that will be done, might be
 done, or is an idea that I want to think about
 
+STUFF
+       * generate all (.hh) files into out dirs
+
+       * sort out headers, see m2m
+
+       * do platform stuff: configure, header(s), targets, build (out?)
+
 BUGS
 
        * plet bugs: scales.ly
@@ -175,4 +182,4 @@ IDEAS
 
        * caching breakpoints
 
-       * use exceptions iso assert?
\ No newline at end of file
+       * use exceptions iso assert?
index 6c589619a0487fba38fd7f495045d4757538e909..5a44cc8816f34e5025f3c16b984249e54f7deca8 100644 (file)
@@ -2,5 +2,5 @@ MAJOR_VERSION = 1
 MINOR_VERSION = 1
 PATCH_LEVEL = 6
 # use to send patches, always empty for released version:
-MY_PATCH_LEVEL = # include separator: "-1" or ".a"
+MY_PATCH_LEVEL = -1# include separator: "-1" or ".a"
 #
index 836eccbee0e80a518f3b3fd0682293c03a5edd58..03f728e91134ce506228d3403e3aa3d5461a515a 100644 (file)
@@ -1,3 +1,8 @@
+pl 1.1.6-1     
+
+Bugfix
+       - small but nasty include/fversion.hh fixed
+
 pl 1.1.6
        - all of 1.1.4-1 and 1.1.5
 Bugfix 
@@ -8,7 +13,9 @@ pl 1.1.5
        - snprintf
 
 pl 1.1.4-1
-       - included in new make structure
+       - included in new make structure, as a library of lilypond; 
+         for compiling you-ll need ../make and ../bin dirs from 
+         lilypond...
        
 pl 1.1.4
        - great file-renaming.
index 893c30f922f46be1265f59cbf7ccbe5d5ca789e1..0eccc67beb125b400540d83b935123a696f55fef 100644 (file)
@@ -33,7 +33,7 @@ SUBDIRS = include
 
 # to be remade each build:
 #
-VERSION_DEPENDENCY = include/fversion.hh
+VERSION_DEPENDENCY =#
 #
 
 # list of c++ header files:
diff --git a/lib/include/windhoos-suck-suck-suck-thank-you-cygnus.hh b/lib/include/windhoos-suck-suck-suck-thank-you-cygnus.hh
new file mode 100644 (file)
index 0000000..540be21
--- /dev/null
@@ -0,0 +1,13 @@
+//
+// windhoos-suck-suck-suck-thank-you-cygnus.hh
+//
+#ifdef _WIN32
+#ifndef WINDHOOS_SUCK_SUCK_SUCK_HH
+#define WINDHOOS_SUCK_SUCK_SUCK_HH
+
+caddr_t mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset);
+
+int munmap(caddr_t addr, size_t len);
+
+#endif // WINDHOOS_SUCK_SUCK_SUCK_HH
+#endif // _WIN32 //
diff --git a/lib/source-file.cc b/lib/source-file.cc
new file mode 100644 (file)
index 0000000..a39a57c
--- /dev/null
@@ -0,0 +1,214 @@
+//
+// source-file.cc
+//
+
+#include <sys/types.h>         // open, mmap
+#include <sys/stat.h>          // open
+#include <sys/mman.h>          // mmap
+#include <limits.h>            // INT_MAX
+#include <fcntl.h>             // open 
+#include <unistd.h>            // close, stat
+#include <stdio.h>             // fdopen
+#include <string.h>            // strerror
+#include <errno.h>             // errno
+#include <assert.h>
+#include <strstream.h>
+
+#include "string.hh"
+#include "proto.hh"
+#include "plist.hh"
+
+//#include "lexer.hh"
+
+#include "debug.hh"
+#include "windhoos-suck-suck-suck-thank-you-cygnus.hh"
+// #include "parseconstruct.hh" // defined_ch_c_l
+extern char const* defined_ch_c_l;
+
+// ugh
+// #include "main.hh"                  // find_file
+String find_file(String);
+
+#include "source-file.hh"
+
+Source_file::Source_file( String &filename_str )
+{
+    data_caddr_ = 0;
+    fildes_i_ = 0;
+    size_off_ = 0;
+    name_str_ = filename_str;
+    istream_p_ = 0;
+
+    open();
+    map();
+    // ugh!?, should call name_str() ! 
+    filename_str = name_str_;
+}
+
+Source_file::~Source_file()
+{
+    delete istream_p_;
+    istream_p_ = 0;
+    unmap();
+    close();
+}
+
+char const*
+Source_file::ch_c_l()
+{
+    assert( this );
+    return (char const*)data_caddr_;
+}
+
+void
+Source_file::close()
+{
+    if ( fildes_i_ ) {
+       ::close( fildes_i_ );
+       fildes_i_ = 0;
+    }
+}
+
+String
+Source_file::error_str( char const* pos_ch_c_l )
+{
+    assert( this );
+    if ( !in_b( pos_ch_c_l ) )
+       return "";
+
+    char const* begin_ch_c_l = pos_ch_c_l;
+    char const* data_ch_c_l = ch_c_l();
+    while ( begin_ch_c_l > data_ch_c_l )
+        if ( *--begin_ch_c_l == '\n' ) {
+           begin_ch_c_l++;
+           break;
+       }
+
+    char const* end_ch_c_l = pos_ch_c_l;
+    while ( end_ch_c_l < data_ch_c_l + size_off_ )
+        if ( *end_ch_c_l++ == '\n' ) {
+           break;
+       }
+    end_ch_c_l--;
+
+#if 1
+//    String( char const* p, int length ) is missing!?
+    String line_str( (Byte const*)begin_ch_c_l, end_ch_c_l - begin_ch_c_l );
+#else
+    int length_i = end_ch_c_l - begin_ch_c_l;
+    char* ch_p = new char[ length_i + 1 ];
+    strncpy( ch_p, begin_ch_c_l, length_i );
+    ch_p[ length_i ] = 0;
+    String line_str( ch_p );
+    delete ch_p;
+#endif
+
+    int error_col_i = 0;
+    char const* scan_ch_c_l = begin_ch_c_l;
+    while ( scan_ch_c_l < pos_ch_c_l )
+       if ( *scan_ch_c_l++ == '\t' )
+           error_col_i = ( error_col_i / 8 + 1 ) * 8;
+       else
+           error_col_i++;
+
+    String str = line_str.left_str( pos_ch_c_l - begin_ch_c_l ) 
+       + String( '\n' )
+       + String( ' ', error_col_i ) 
+       + line_str.mid_str( pos_ch_c_l - begin_ch_c_l, INT_MAX ); // String::mid should take 0 arg..
+    return str;
+}
+
+bool
+Source_file::in_b( char const* pos_ch_c_l )
+{
+    return ( pos_ch_c_l && ( pos_ch_c_l >= ch_c_l() ) && ( pos_ch_c_l < ch_c_l() + size_off_ ) );
+}
+
+istream*
+Source_file::istream_l()
+{
+    assert( fildes_i_ );
+    if ( !istream_p_ ) {
+       if ( size_off_ ) // can-t this be done without such a hack?
+           istream_p_ = new istrstream( ch_c_l(), size_off_ );
+        else {
+           istream_p_ = new istrstream( "", 0 );
+           istream_p_->set(ios::eofbit);
+       }
+    }
+    return istream_p_;
+}
+
+off_t
+Source_file::length_off()
+{
+    return size_off_;
+}
+
+int
+Source_file::line_i( char const* pos_ch_c_l )
+{
+    if ( !in_b( pos_ch_c_l ) )
+       return 0;
+
+    int i = 1;
+    char const* scan_ch_c_l = ch_c_l();
+    while ( scan_ch_c_l < pos_ch_c_l )
+       if ( *scan_ch_c_l++ == '\n' )
+               i++;
+    return i;
+}
+
+void
+Source_file::map()
+{
+    if ( fildes_i_ == -1 )
+       return;
+
+    data_caddr_ = (caddr_t)mmap( (void*)0, size_off_, PROT_READ, MAP_SHARED, fildes_i_, 0 );
+
+    if ( (int)data_caddr_ == -1 )
+       // ugh: defined_ch_c_l...
+       warning( String( "can't map: " ) + name_str_ + String( ": " ) + strerror( errno ), defined_ch_c_l ); //lexer->here_ch_c_l() );
+}
+
+String
+Source_file::name_str()
+{
+    return name_str_;
+}
+
+void
+Source_file::open()
+{
+    String name_str = find_file( name_str_ );
+    if ( name_str != "" ) 
+        name_str_ = name_str;
+
+    fildes_i_ = ::open( name_str_, O_RDONLY ); 
+           
+    if ( fildes_i_ == -1 ) {
+       warning( String( "can't open: " ) + name_str_ + String( ": " ) + strerror( errno ), defined_ch_c_l ); // lexer->here_ch_c_l() );
+        return;
+    }
+
+    struct stat file_stat;
+    fstat( fildes_i_, &file_stat );
+    size_off_ = file_stat.st_size;
+}
+
+void
+Source_file::unmap()
+{
+    if ( data_caddr_ ) {
+       munmap( data_caddr_, size_off_ );
+       data_caddr_ = 0;
+       size_off_ = 0;
+    }
+}
+String
+Source_file::file_line_no_str(char const *ch_c_l )
+{
+    return name_str() + ": "
+       + String( line_i( ch_c_l ) );
+}
diff --git a/lib/windhoos-suck-suck-suck-thank-you-cygnus.cc b/lib/windhoos-suck-suck-suck-thank-you-cygnus.cc
new file mode 100644 (file)
index 0000000..15db908
--- /dev/null
@@ -0,0 +1,103 @@
+//
+// windhoos.cc
+//
+#ifdef _WIN32
+
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <winbase.h>
+#include "windhoos-suck-suck-suck-thank-you-cygnus.hh"
+
+/* 
+HANDLE CreateFileMapping(
+    HANDLE hFile,      // handle to file to map 
+    LPSECURITY_ATTRIBUTES lpFileMappingAttributes,     // optional security attributes 
+    DWORD flProtect,   // protection for mapping object 
+    DWORD dwMaximumSizeHigh,   // high-order 32 bits of object size  
+    DWORD dwMaximumSizeLow,    // low-order 32 bits of object size  
+    LPCTSTR lpName     // name of file-mapping object 
+   );  
+
+LPVOID MapViewOfFile(
+    HANDLE hFileMappingObject, // file-mapping object to map into address space  
+    DWORD dwDesiredAccess,     // access mode 
+    DWORD dwFileOffsetHigh,    // high-order 32 bits of file offset 
+    DWORD dwFileOffsetLow,     // low-order 32 bits of file offset 
+    DWORD dwNumberOfBytesToMap         // number of bytes to map 
+   );  
+
+io.h:
+long _get_osfhandle( int filehandle );
+*/
+
+// cygnus's gnu-win32-b17.1 does not have _get_osfhandle
+// however, after some hacking, it turns out that:
+
+static const int OSF_OFFSET_i = 72;  
+static const int OSF_BASE_i = -3;
+static const int OSF_FACTOR_i = 8;  
+// let-s hope bill doesn-t change his mind any time soon :-)
+
+// so that, while waiting for cygnus's mmap, we can write:
+
+// #define HAVE_GET_OSFHANDLE  // no we still cannot; works only with cl.exe
+long
+_get_osfhandle( int filedes_i )
+{
+    return (long)( OSF_OFFSET_i + ( filedes_i + OSF_BASE_i ) * OSF_FACTOR_i );
+}
+
+#ifdef HAVE_GET_OSFHANDLE
+
+#include <iostream.h>
+
+caddr_t
+mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
+{
+    (void)flags;
+    (void)prot;
+    (void)addr;
+    HANDLE osf = (HANDLE)_get_osfhandle( fd );
+    HANDLE file_handle = CreateFileMapping( osf, (void*)0, PAGE_READONLY,
+       0, len, 0 ); 
+    return (caddr_t)MapViewOfFile( file_handle, FILE_MAP_READ, 0, offset, len );
+}
+
+
+int
+munmap(caddr_t addr, size_t len)
+{
+    (void)len;
+    return UnmapViewOfFile( addr );
+}
+
+#else // ! HAVE_GET_OSFHANDLE //
+
+caddr_t
+mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
+{
+    (void)flags;
+    (void)prot;
+    (void)addr;
+    (void)offset;
+    char* ch_p = new char[ len ];
+    if ( ch_p )
+        read( fd, (void*)ch_p, len );
+    return ch_p;
+}
+
+
+int
+munmap(caddr_t addr, size_t len)
+{
+    (void)len;
+    delete (char*)addr;
+    return 0;
+}
+
+#endif // !HAVE_GET_OSFHANDLE //
+
+
+#endif // _WIN32 //
diff --git a/make/Targets.make b/make/Targets.make
new file mode 100644 (file)
index 0000000..884eef7
--- /dev/null
@@ -0,0 +1,126 @@
+#
+# project  LilyPond -- the musical typesetter
+# title           generic make rules
+# file    make/Rules.make
+#
+# Copyright (c) 1997 by    
+#      Jan Nieuwenhuizen <jan@digicash.com>
+#      Han-Wen Nienhuys <hanwen@stack.nl>
+
+.PHONY : all clean default dist doc doc++ dummy exe help lib tags
+
+# target all:
+#
+all:    default
+       for i in $(SUBDIRS); do $(MAKE) -C $$i all; done
+#
+
+# dependency list of executable:
+#
+EXECUTABLE = $(bindir)/$(NAME)
+$(EXECUTABLE): $(OFILES) $(CUSTOMLIBES)
+#      $(STRIPDEBUG) $(STABLEOBS)
+#      $(LD_COMMAND) -o $@ $^ $(LOADLIBES)
+       $(LD_COMMAND) $(OFILES) $(LOADLIBES)
+       touch $(VERSION_DEPENDENCY)
+       $(INCREASE_BUILD)
+       touch $(build) #waai necessary?
+#
+exe: $(EXECUTABLE)
+#
+
+# dependency list of library:
+#
+LIBRARY = $(libdir)/$(LIB_PREFIX)$(NAME)$(LIB_SUFFIX)
+$(LIBRARY): $(OFILES) $(CUSTOMLIBES)
+       $(AR_COMMAND) $(OFILES)
+       touch $(VERSION_DEPENDENCY)
+       $(INCREASE_BUILD)
+       touch $(build) #waai necessary?
+#
+lib: $(LIBRARY)
+#
+
+clean:
+       rm -f $(allexe) core $(allobs) 
+       for i in $(SUBDIRS); do $(MAKE) -C $$i clean; done
+
+distclean: clean
+       rm -rf  $(lily-version) $(flower-version) .b $(build) .GENERATE *~ $(allout)
+
+
+# configure:
+#
+config:
+       $(bindir)/configure
+#
+
+# value of $(OSTYPE) on windhoos; "make $OSTYPE" if you use bash :-)
+#
+win32: 
+       $(MAKE) -C . CXX=g++ 
+#
+
+# xcompile to doze:
+#
+doze:  dos
+dos: 
+       $(MAKE) -C . CXX="gcc-go32 -I/usr/i386-go32/include -I/usr/i386-go32/include/g++ -D_WIN32 -Dcaddr_t=char* -DMAP_SHARED=0"
+#
+
+# target help:
+#
+help:
+       @echo "Usage:"
+       @echo " $(MAKE) ["VARIABLE=value" ...] [target]"
+       @echo
+       @echo "targets:"
+       @echo " all clean config dist distclean doc doc++"
+       @echo " exe help lib moduledist tags"
+       @echo " dos:    xcomplile to dos"
+       @echo " win32:  native cygnus-win32 compile" 
+#
+
+doc:
+       $(MAKE) -C Documentation do-doc
+
+# doc++ documentation of classes
+doc++: $(progdocs)     
+       doc++ -kp -d $(DOCDIR) $^
+
+dist:
+       -mkdir $(distdir)
+       $(MAKE) localdist
+       (cd ./$(depth); tar cfz $(DIST_NAME).tar.gz $(DIST_NAME))
+       rm -rf $(distdir)/  # should be trapped
+
+localdist:
+       ln $(DISTFILES) $(distdir)/$(localdir)
+       for i in $(SUBDIRS); do mkdir $(distdir)/$(localdir)/$$i; done
+       for i in $(SUBDIRS); do $(MAKE) localdir=$(localdir)/$$i -C $$i localdist; done
+
+moduledist:
+       -mkdir $(module-distdir)
+       $(MAKE) localmoduledist
+       (cd ./$(depth); tar cfz $(MODULE_DIST_NAME).tar.gz $(MODULE_DIST_NAME))
+       rm -rf $(module-distdir)/  # should be trapped
+
+localmoduledist:
+       ln $(DISTFILES) $(module-distdir)/$(localdir)
+       for i in $(SUBDIRS); do mkdir $(module-distdir)/$(localdir)/$$i; done
+       for i in $(SUBDIRS); do $(MAKE) localdir=$(localdir)/$$i -C $$i localmoduledist; done
+
+all-tags: tags
+       for i in $(SUBDIRS); do $(MAKE) -C $$i all-tags; done
+
+tags:
+       etags -CT $(allcc) 
+
+# version stuff:
+#
+check-flower-version:
+       $(MAKE) flower-version -C ./$(depth)/flower
+$(lily-version): ./$(depth)/.version ./$(bindir)/make_version $(build)
+       ./$(bindir)/make_version "$(MAJOR_VERSION)" "$(MINOR_VERSION)" "$(PATCH_LEVEL)" "$(MY_PATCH_LEVEL)" "$(BUILD)" "$(CXX) $(CXXVER)" > $@
+#
+
diff --git a/make/Template.make b/make/Template.make
new file mode 100644 (file)
index 0000000..016ebf0
--- /dev/null
@@ -0,0 +1,97 @@
+# 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 
+#
+# Copyright (c) 1997 by
+#      Jan Nieuwenhuizen <jan@digicash.com>
+#      Han-Wen Nienhuys <hanwen@stack.nl>
+#
+
+# subdir level:
+#
+depth = ..
+#
+
+# identify 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 
+#
+
+# descent order into subdirectories:
+#
+SUBDIRS =
+#
+
+# to be remade each build:
+#
+VERSION_DEPENDENCY = $(lily-version)
+#
+
+# module compile settings: (not generally needed!
+#
+EXTRA_CFLAGS =
+EXTRA_CXXFLAGS =
+EXTRA_LDFLAGS =
+#
+
+# list of c++ header files:
+# 
+HHFILES = $(shell ls *.hh)
+#
+
+# list of c++ source files:
+#
+CCFILES = $(shell ls *.cc)
+#
+
+# list of other source files:
+#
+EXTRA_SOURCE_FILES = $(shell ls *.y *.l)
+#
+
+# list of distribution files:
+#
+DISTFILES = $(HHFILES) $(CCFILES) $(EXTRA_SOURCE_FILES)
+#
+
+# list of custom libraries:
+#
+CUSTOMLIBES = \
+
+LOADLIBES +=
+#
+
+# main target of this module:
+#
+MAINTARGET = $(EXECUTABLE)
+# MAINTARGET = $(LIBRARY)
+
+default: $(MAINTARGET)
+#
+
+# generic targets and rules:
+#
+include ./$(depth)/make/Targets.make
+include ./$(depth)/make/Rules.make
+#
+
+# auto dependencies:
+#
+include ./$(outdir)/*.dep
+#
+
diff --git a/make/User.make b/make/User.make
new file mode 100644 (file)
index 0000000..5a8be80
--- /dev/null
@@ -0,0 +1,40 @@
+#
+# project  LilyPond -- the musical typesetter
+# title           user changeable settings
+# file    make/User.make
+#
+# Copyright (c) 1997 by    
+#      Jan Nieuwenhuizen <jan@digicash.com>
+#      Han-Wen Nienhuys <hanwen@stack.nl>
+
+# this still sux
+# will be split into CFLAGS/EXTRA_CFLAGS etc, 
+# so that defineable generically and per module
+
+# you-re using a i386, eh?
+#
+#PROFILEFLAG=-pg
+#
+
+# optimization and debugging:
+#
+# if defined (=not commented-out), debugging flag is ignored!
+OPTIFLAG=-DNDEBUG -DNPRINT -O2
+#
+DEBUGFLAG=-g
+#
+
+# turn off -pipe if linker doesn't support it
+# 
+USER_CXXFLAGS=-pipe -Wall -W   -Wmissing-prototypes -DSTRING_UTILS_INLINED -O
+#
+
+#
+# -lefence = ElectricFence.
+#
+# ElectricFence is a memory debugger which uses the 
+# VM hardware to trap malloc/free errors.
+#
+
+EXTRALIB+= #-lefence
+
diff --git a/make/Variables.make b/make/Variables.make
new file mode 100644 (file)
index 0000000..824c16d
--- /dev/null
@@ -0,0 +1,154 @@
+#
+# project  LilyPond -- the musical typesetter
+# title           generic variables
+# file    make/Variables.make
+# abstract do not change this file; edit settings in User.make
+#
+# Copyright (c) 1997 by    
+#      Jan Nieuwenhuizen <jan@digicash.com>
+#      Han-Wen Nienhuys <hanwen@stack.nl>
+
+# toplevel version info, might be handy?
+#
+include ./$(depth)/.version
+#
+
+# directory names:
+#
+outdir = out# "objects" won-t do, used for libs and deps as well
+bindir = ./$(depth)/bin
+distdir = ./$(depth)/$(DIST_NAME)
+module-distdir = ./$(depth)/$(MODULE_DIST_NAME)
+depdir = $(outdir)
+libdir = $(outdir)
+flowerout = ./$(depth)/flower/lib/$(outdir)
+libout = ./$(depth)/lib/$(outdir)
+# flower-dir = ./$(depth)/flower
+include-lib = ./$(depth)/lib/include
+include-flower = ./$(depth)/flower/lib/include
+#
+
+# user settings:
+#
+include ./$(depth)/make/User.make
+#
+
+ifdef PROFILEFLAG
+       DEFINES+=$(OPTIFLAG) $(PROFILEFLAG)
+       EXTRA_LIBES+=-pg
+endif
+
+ifndef DEBUGFLAG
+       DEFINES+=$(OPTIFLAG)
+else
+       DEFINES+=$(DEBUGFLAG)
+endif
+
+# build no:
+#
+# need to be defined in local Makefiles:
+# build = ./$(depth)/lily/.build
+BUILD = $(shell cat $(build))
+INCREASE_BUILD = @echo `expr \`cat $(build)\` + 1` > .b; mv .b $(build)
+#
+
+# the version:
+#
+VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL)$(MY_PATCH_LEVEL)
+TOPLEVEL_VERSION=$(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)$(TOPLEVEL_MY_PATCH_LEVEL)
+#
+
+# compiler version:
+#
+CXXVER=`$(CXX) --version`
+#
+
+# module and top level dist:
+#
+# fix naming, use TOPLEVEL_ prefix _or_ MODULE?
+MODULE_DIST_NAME = $(MODULE_NAME)-$(VERSION)
+DIST_NAME = lilypond-$(TOPLEVEL_VERSION)
+#
+
+# list of object files:
+#
+SOURCE_FILES = $(CCFILES) $(EXTRA_SOURCE_FILES)
+OFILEC = $(SOURCE_FILES:.c=.o)
+OFILECC = $(OFILEC:.cc=.o)
+OFILEL = $(OFILECC:.l=.o)
+OFILEY = $(OFILEL:.y=.o)
+OFILES = $(patsubst %,$(outdir)/%,$(OFILEY))
+#
+
+# clean file lists:
+#
+allexe = $(bindir)/lilypond $(bindir)/m2m
+allobs = $(shell find $(outdir) -name "*.o" )
+allibs = $(shell find $(libdir) -name "*.lib" )
+alldeps = $(shell find $(outdir) -name "*.dep" )
+allout = $(shell find . -name "$(outdir)" )
+#
+
+# version stuff:
+#
+flower-version = $(flowerout)/fversion.hh
+lily-version = $(libout)/version.hh
+#
+
+# custom libraries:
+#
+LIBFLOWER = $(depth)/flower/lib/$(outdir)/$(LIB_PREFIX)flower$(LIB_SUFFIX)
+LIBLILY = $(depth)/lib/$(outdir)/$(LIB_PREFIX)lily$(LIB_SUFFIX)
+#
+
+# compile and link options:
+#
+ARFLAGS = ru
+CFLAGS = $(DEFINES) $(INCLUDES) $(USER_CFLAGS) $(EXTRA_CFLAGS)
+CXXFLAGS = $(CFLAGS) $(USER_CXXFLAGS) $(EXTRA_CXXFLAGS)
+INCLUDES = -Iinclude -I$(outdir) -I$(include-lib) -I$(libout) -I$(include-flower) -I$(flowerout) 
+CXX_OUTPUT_OPTION = $< -o $@
+LDFLAGS = $(EXTRA_LDFLAGS)
+LOADLIBES = $(EXTRA_LIBES) $(CUSTOMLIBES) -lg++
+#
+
+# librarian:
+#
+AR = ar
+AR_COMMAND = $(AR) $(ARFLAGS) $@
+#
+
+# compiler:
+#
+# "CC = $(CC)"
+# "CXX = $(CXX)"
+#
+
+# linker:
+#
+LD = $(CXX)
+LD_COMMAND = $(LD) $(LDFLAGS) -o $@
+#
+
+# dependencies:
+#
+depfile = ./$(depdir)/$(subst .o,.dep,$(notdir $@)) 
+DODEP=rm -f $(depfile); DEPENDENCIES_OUTPUT="$(depfile) $(outdir)/$(notdir $@)"
+#
+
+# utils:
+#
+FLEX = flex
+BISON = bison
+#
+
+# generic target names:
+#
+EXECUTABLE = $(NAME)$(EXE)
+LIB_PREFIX = lib
+LIB_SUFFIX = .a
+LIBRARY = $(LIB_PREFIX)$(NAME)$(LIB_SUFFIX)
+#
+
+STRIPDEBUG=true #replace to do stripping of certain objects
+