-# 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
+depth = ..
-#ugh
-Makefile=$(wildcard Makefile)
-# are we configured here, or are we using --srcdir
-ifeq ($(Makefile),Makefile)
+NAME = lilypond
+SUBDIRS = include
-include Makefile
+MODULE_LIBS= $(depth)/flower $(depth)/kpath-guile
+MODULE_INCLUDES= $(depth)/flower/include
-biltdir=.
+# need this to convert between function pointers and member function pointers.
+MODULE_CXXFLAGS= -Wno-pmf-conversions
-else
-#ugh
-biltdir=../../build/lily
+HELP2MAN_EXECS = lilypond
+STEPMAKE_TEMPLATES=c c++ executable po help2man
-make-in-build: wild-check
- echo exec $(MAKE) -C $(biltdir)
- exec $(MAKE) -C $(biltdir)
+OUT_DIST_FILES=$(addprefix $(outdir)/,parser.cc parser.hh )
-include $(biltdir)/Makefile
+include $(depth)/make/stepmake.make
-clean: wild-check
- exec $(MAKE) -C $(biltdir) $@
+ifeq ($(HAVE_LIBKPATHSEA_SO),no)
+MODULE_LDFLAGS += $(KPATHSEA_LIBS)
+endif
+ifeq ($(LINK_GXX_STATICALLY),yes)
+MODULE_LDFLAGS += -L$(outdir) -static-libgcc
+endif
-dist: wild-check
- exec $(MAKE) -C $(biltdir) $@
-distclean: wild-check
- exec $(MAKE) -C $(biltdir) $@
-lexer.cc: wild-check
- exec $(MAKE) -C $(biltdir) $@
+# for profiling, link guile statically:
+#
+# CONFIG_LDFLAGS += -static -lltdl -ldl
+#
+
+ifeq ($(PLATFORM_WINDOWS),yes)
+WINDRES_FLAGS += -DLilyPond=0 -DLY=1
+O_FILES += $(outdir)/lilypond.rc.o
+$(outdir)/lilypond: $(outdir)/lilypond.rc.o
+
+$(outdir)/lilypond.rc.o: $(outdir)/lilypond.ico $(outdir)/ly.ico
+$(top-build-dir)/Documentation/pictures/$(outbase)/lilypond.ico:
+ $(MAKE) -C $(top-src-dir)/Documentation/pictures
+$(outdir)/lilypond.ico: $(top-build-dir)/Documentation/pictures/$(outbase)/lilypond.ico
+ cp $< $@
+$(top-build-dir)/Documentation/pictures/$(outbase)/ly.ico:
+ $(MAKE) -C $(top-src-dir)/Documentation/pictures
+$(outdir)/ly.ico: $(top-build-dir)/Documentation/pictures/$(outbase)/ly.ico
+ cp $< $@
+endif
-parser.hh: wild-check
- exec $(MAKE) -C $(biltdir) $@
+ETAGS_FLAGS += --regex='{c++}/^LY_DEFINE *(\([^,]+\)/\1/'
+ETAGS_FLAGS += --regex='{c++}/^LY_DEFINE *([^"]*"\([^"]+\)"/\1/'
-parser.cc: wild-check
- exec $(MAKE) -C $(biltdir) $@
+default:
-#ugh OMIT_DEPENDENCIES does not seem to work
-.deps/lexer.P:
- exec $(MAKE) -C $(biltdir) $@
-.deps/parser.P:
- exec $(MAKE) -C $(biltdir) $@
+$(outdir)/libstdc++.a:
+ rm -f $@
+ ln -s `$(CXX) -print-file-name=libstdc++.a` $(outdir)/
+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.hh
+$(outdir)/lily-lexer.o: $(outdir)/parser.hh $(outdir)/FlexLexer.h
+$(outdir)/lexer.o: $(outdir)/parser.hh $(outdir)/version.hh
+
+ifneq ($(FLEXLEXER_PATH),)
+$(outdir)/FlexLexer.h: $(FLEXLEXER_PATH)/FlexLexer.h
+ cp $< $@
endif
-# Makefile.am.wild: lilypond_SOURCES = $(wildcard *.cc *.ll *.yy)
-# ugh
-CURRENT_lilypond_SOURCES = $(wildcard *.cc lexer.ll parser.yy)
-# ugh: stupid lexer.cc/parser.cc cluttering sourcedir!
-wild-check: check-lilypond-sources
-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
+$(outdir)/general-scheme.o: $(outdir)/version.hh
+$(outdir)/kpath.o: $(outdir)/version.hh
+$(outdir)/lily-guile.o: $(outdir)/version.hh
+$(outdir)/lily-version.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
+
+foe:
+ @echo b:$(build-dir)
+ @echo s:$(src-dir)
+ @echo t:$(tree-dir)