]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/GNUmakefile
Tie LilyPond, lexer and parser together more type-safely.
[lilypond.git] / lily / GNUmakefile
index 0a05b2684968ebd32c77b39796a6290ea2f0e66e..d784760d9c0315dece3669cd71985f28661b88cf 100644 (file)
@@ -1,72 +1,92 @@
-# lilypond/GNUmakefile
-#
-# This file helps maintainers to keep their Makefile.am automatically
-# up to date using GNU make features.
-# If you don't have (or run) GNU make, Makefile.am will not be updated
-# automatically when source files are added/removed.
-
-# automake/wild-make should generate this file from Makefile.am.wild
 
-#ugh
-Makefile=$(wildcard Makefile)
-# are we configured here, or are we using --srcdir
-ifeq ($(Makefile),Makefile)
+depth = ..
 
-include Makefile
+NAME = lilypond
+SUBDIRS = include
 
-biltdir=.
+MODULE_LIBS=$(depth)/flower
+MODULE_INCLUDES= $(depth)/flower/include
 
-else
+# need this to convert between function pointers and member function pointers.
+MODULE_CXXFLAGS= -Wno-pmf-conversions 
 
-#ugh
-biltdir=../../build/lily
 
-make-in-build: wild-check
-       echo exec $(MAKE) -C $(biltdir)
-       exec $(MAKE) -C $(biltdir)
+HELP2MAN_EXECS = lilypond
+STEPMAKE_TEMPLATES=c c++ executable po help2man
 
-include $(biltdir)/Makefile
+OUT_DIST_FILES=$(addprefix $(outdir)/,parser.hh parser.cc)
 
-clean: wild-check
-       exec $(MAKE) -C $(biltdir) $@
+include $(depth)/make/stepmake.make
 
-dist: wild-check
-       exec $(MAKE) -C $(biltdir) $@
+ifeq ($(LINK_GXX_STATICALLY),yes)
+MODULE_LDFLAGS += -L$(outdir) -static-libgcc
+endif
 
-distclean: wild-check
-       exec $(MAKE) -C $(biltdir) $@
+CXXFLAGS += -Woverloaded-virtual
 
-lexer.cc: wild-check
-       exec $(MAKE) -C $(biltdir) $@
 
-parser.hh: wild-check
-       exec $(MAKE) -C $(biltdir) $@
+# for profiling, link guile statically:
+#
+# CONFIG_LDFLAGS += -static -lltdl -ldl
+#
 
-parser.cc: wild-check
-       exec $(MAKE) -C $(biltdir) $@
+ifeq ($(PLATFORM_WINDOWS),yes)
+WINDRES_FLAGS += -DLilyPond=0 -DLY=1
+O_FILES += $(outdir)/lilypond.rc.o
+$(outdir)/lilypond: $(outdir)/lilypond.rc.o
 
-#ugh OMIT_DEPENDENCIES does not seem to work
-.deps/lexer.P:
-       exec $(MAKE) -C $(biltdir) $@
+$(outdir)/lilypond.rc.o: $(outdir)/lilypond.ico $(outdir)/ly.ico
+$(top-build-dir)/Documentation/logo/$(outbase)/lilypond.ico:
+       $(MAKE) -C $(top-build-dir)/Documentation/logo
 
-.deps/parser.P:
-       exec $(MAKE) -C $(biltdir) $@
+$(outdir)/lilypond.ico: $(top-build-dir)/Documentation/logo/$(outbase)/lilypond.ico
+       cp $< $@
+$(top-build-dir)/Documentation/logo/$(outbase)/ly.ico:
+       $(MAKE) -C $(top-build-dir)/Documentation/logo
 
+$(outdir)/ly.ico: $(top-build-dir)/Documentation/logo/$(outbase)/ly.ico
+       cp $< $@
 endif
 
-# Makefile.am.wild: lilypond_SOURCES = $(wildcard *.cc *.ll *.yy)
-# ugh
-CURRENT_lilypond_SOURCES = $(wildcard *.cc lexer.ll parser.yy)
+ETAGS_FLAGS += --regex='{c++}/^LY_DEFINE *(\([^,]+\)/\1/'
+ETAGS_FLAGS += --regex='{c++}/^LY_DEFINE *([^"]*"\([^"]+\)"/\1/'
+
+default:
+
 
-# ugh: stupid lexer.cc/parser.cc cluttering sourcedir!
-wild-check: check-lilypond-sources
+$(outdir)/libstdc++.a:
+       rm -f $@
+       ln -s `$(CXX) -print-file-name=libstdc++.a` $(outdir)
 
-check-lilypond-sources:
-ifneq ($(lilypond_SOURCES),$(filter-out $(IGNORE_WILDCARDS), $(CURRENT_lilypond_SOURCES)))
-       @echo \"$(lilypond_SOURCES)\"
-       @echo \"$(CURRENT_lilypond_SOURCES)\"
-       @echo  lilypond_SOURCES changed: rerunning make-wild.
-       @-rm -f Makefile.am
-       $(PERL) $(top_srcdir)/bin/wild-perl < Makefile.am.wild > Makefile.am
+ifeq ($(LINK_GXX_STATICALLY),yes)
+$(outdir)/lilypond: $(outdir)/libstdc++.a
 endif
 
+# force these: Make can't know these have to be generated in advance
+$(outdir)/lily-parser.o $(outdir)/parser.o: $(outdir)/parser.hh
+$(outdir)/lily-lexer.o: $(outdir)/parser.hh $(outdir)/FlexLexer.h
+$(outdir)/lexer.o: $(outdir)/parser.hh $(outdir)/version.hh
+$(outdir)/lily-lexer-scheme.o $(outdir)/lily-parser-scheme.o: $(outdir)/parser.hh
+
+ifneq ($(FLEXLEXER_FILE),)
+$(outdir)/FlexLexer.h: $(FLEXLEXER_FILE) $(config_h)
+       cp $< $@
+endif
+
+$(outdir)/lexer.cc: $(config_h)
+$(outdir)/parser.cc: $(config_h)
+
+$(outdir)/general-scheme.o: $(outdir)/version.hh
+$(outdir)/lily-guile.o: $(outdir)/version.hh
+$(outdir)/lily-version.o: $(outdir)/version.hh
+$(outdir)/main.o: $(outdir)/version.hh
+$(outdir)/relocate.o: $(outdir)/version.hh
+$(outdir)/warn-scheme.o: $(outdir)/version.hh
+
+local-po: $(outdir)/parser.cc
+
+# ugh.  For --srcdir builds, these must exist to satisfy their broken
+# lexer.dep and parser.dep file entries.
+ifneq ($(configure-srcdir),.)
+.PRECIOUS: $(outdir)/lexer.cc $(outdir)/parser.cc
+endif