]> git.donarmstrong.com Git - lilypond.git/blobdiff - Makefile
partial: 0.0.38.hanjan
[lilypond.git] / Makefile
index c85f6fd2ff33d249e78ea2673d1050cfcaeb2782..c990a7246c1356fc06293bb228f6c8deaa094539 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,97 +1,65 @@
-MAJVER=0
-MINVER=0
-PATCHLEVEL=6
-
-# 
-#
-
-include Sources.make
-progdocs=$(hdr) $(mycc)
-gencc=parser.cc lexer.cc
-cc=$(mycc) $(gencc)
-obs=$(cc:.cc=.o) 
-
-
-#dist
-
-DOCDIR=docdir
-VERSION=$(MAJVER).$(MINVER).$(PATCHLEVEL)
-PACKAGENAME=lilypond
-DNAME=$(PACKAGENAME)-$(VERSION)
-othersrc=lexer.l parser.y
-SCRIPTS=make_version make_patch genheader
-IFILES=dimen.tex symbol.ini suzan.ly maartje.ly\
-       lilyponddefs.tex test.tex .dstreamrc
-OFILES=Makefile Sources.make 
-DOC=COPYING README TODO CodingStyle
-DFILES=$(hdr) $(mycc) $(othersrc) $(OFILES) $(IFILES) $(SCRIPTS) $(DOC)
-
-#compiling
-LOADLIBES=-L$(FLOWERDIR) -lflower
-FLOWERDIR=../flower
-# speedy
-#DEFINES=-DNDEBUG -DNPRINT -O2
-# lots of debugging info
-DEFINES=-g
-
-CXXFLAGS=$(DEFINES) -I$(FLOWERDIR) -pipe -Wall -W  -pedantic 
-FLEX=flex
-BISON=bison
-exe=$(PACKAGENAME)
-
-##################################################################
+# Makefile
+# top level makefile of LilyPond
+
+include Variables.make 
+
+.SUFFIXES:
+.SUFFIXES: .cc .o .hh .y .l .pod .txt .1 .dep
+
 
 $(exe): $(obs)
-       $(CXX) -o $@ $(obs) $(LOADLIBES)
+       $(STRIPDEBUG) $(STABLEOBS)
+       $(LINKER) -o $@ $^ $(LOADLIBES)
+
+$(m2m):        $(m2mobs)
+       $(LINKER) -o $@ $^ $(LOADLIBES)
+
+.PHONY: clean docxx
+
 clean:
-       rm -f $(exe) *.o $(DOCDIR)/* core  
+       rm -f $(allexe) $(DOCDIR)/* core $(allobs) 
+       for SUBDIR in $(SUBDIRS); \
+       do \
+               $(MAKE) SUBDIR=$$SUBDIR -C $$SUBDIR clean;\
+       done
 
 distclean: clean
-       rm -f TAGS depend version.hh $(gencc) .GENERATE *~
-
-all: kompijl doc
+       rm -f  version.hh $(gencc) .GENERATE *~ $(ALLDEPS) 
 
-# doc++ documentation of classes
-doc:
-       -mkdir $(DOCDIR)
-       doc++ -p -I -d $(DOCDIR) $(progdocs)
+all: $(exe) $(m2m) doc
 
-depend: Sources.make  .GENERATE
-       $(CXX) $(CXXFLAGS) -MM $(cc) > $@
+# value of $(OSTYPE) on windhoos; "make $OSTYPE" if you use bash :-)
+win32: 
+       $(MAKE) -C . CXX=g++ 
 
-# hack to create these sources once, before the dependencies
-.GENERATE:
-       touch .GENERATE depend
-       $(MAKE) version.hh
-       $(MAKE) $(gencc)
-       rm -f depend
+doc:
+       $(MAKE) -C Documentation doc
 
-include depend
+# doc++ documentation of classes
+docxx: $(progdocs)     
+       doc++ -kp -d $(DOCDIR) $^
 
-parser.cc: parser.y
-       $(BISON) -d $<
-       mv parser.tab.h parser.hh
-       mv parser.tab.c parser.cc
 
-parser.hh: parser.cc
+include $(DEPDIR)/*.dep
 
-version.o: $(obs) version.hh
+$(OBJECTDIR)/%.o: $(CCDIR)/%.cc
+       $(DODEP)\
+       $(CXX) -c $(CXXFLAGS) $(OUTPUT_OPTION) 
 
-version.hh: Makefile make_version
-       make_version $(MAJVER) $(MINVER) $(PATCHLEVEL)  > $@
+$(OBJECTDIR)/version.o: $(obs) $(HEADERDIR)/version.hh
 
-lexer.cc: lexer.l
-       $(FLEX) -+ -t $< > $@
+include Generate.make
 
-DDIR=$(DNAME)
 dist:
        -mkdir $(DDIR)
        ln $(DFILES) $(DDIR)/
-       tar cfz $(DNAME).tar.gz $(DDIR)/
+       for SUBDIR in $(SUBDIRS); \
+       do      mkdir $(DDIR)/$$SUBDIR; \
+               $(MAKE) SUBDIR=$$SUBDIR -C $$SUBDIR dist;\
+       done
+       tar cfz $(DNAME).tar.gz $(DNAME)/
        rm -rf $(DDIR)/
 
-
-TAGS: $(mycc) $(hdr) Sources.make
-       etags -CT $(mycc) $(hdr) 
-
-
+TAGS:
+       $(MAKE) -C $(HEADERDIR) TAGS
+       $(MAKE) -C $(CCDIR) TAGS