# Jan Nieuwenhuizen <jan@digicash.com>
# Han-Wen Nienhuys <hanwen@stack.nl>
-.PHONY : all clean config default dist doc doc++ dummy exe help lib TAGS
+.PHONY : all clean config default dist doc doc++ dummy exe help lib TAGS html\
+ check-flower-deps check-lib-deps check-doc-deps
# target all:
#
all: default
- for i in $(SUBDIRS); do $(MAKE) -C $$i all; done
-#
-
-# platform specific variables,
-#
-include ./$(depth)/make/out/Site.make
-#
-
-# where to do this ?
-.PRECIOUS: $(makeout)/Site.make
-
-# ... and configure bootstrap :-)
-#
-$(makeout)/Site.make: $(make-dir)/$(genout) $(flower-config) $(lily-config)
-# this is handy, but runs on second "make distclean" too. ah well...
-# if [ \! -d $(makeout) ]; then mkdir $(makeout); fi
- touch $@
- @echo "oeps, sources were not configured!"
- (cd $(depth); ./configure)
-#
-
+ $(LOOP)
# dependency list of executable:
#
-EXECUTABLE = $(bindir)/$(NAME)
-$(EXECUTABLE): $(OFILES) $(CUSTOMLIBES)
-# $(STRIPDEBUG) $(STABLEOBS)
-# $(LD_COMMAND) -o $@ $^ $(LOADLIBES)
+
+$(EXECUTABLE): $(configheader) $(OFILES) $(outdir)/version.hh
+ifdef MODULE_LIBDEPS
+ $(MAKE) $(MODULE_LIBDEPS)
+endif
+ifdef STABLEOBS
+ $(DO_STRIP) $(STABLEOBS)
+endif
$(LD_COMMAND) $(OFILES) $(LOADLIBES)
- -@touch $(VERSION_DEPENDENCY) $(ERROR_LOG)
- $(INCREASE_BUILD)
- touch $(build) #waai necessary?
-#
+
exe: $(EXECUTABLE)
-#
+
# dependency list of library:
#
-LIBRARY = $(libdir)/$(LIB_PREFIX)$(NAME)$(LIB_SUFFIX)
-$(LIBRARY): $(OFILES) $(CUSTOMLIBES)
+$(LIBRARY): $(configheader) $(OFILES)
$(AR_COMMAND) $(OFILES)
- -@touch $(VERSION_DEPENDENCY) $(ERROR_LOG)
- $(INCREASE_BUILD)
- touch $(build) #waai necessary?
+ $(RANLIB_COMMAND)
+
+$(SHAREDLIBRARY): $(configheader) $(OFILES) $(MODULE_LIBDEPS)
+ $(LD_COMMAND) $(OFILES) -o $@.$(VERSION)
+ rm -f $@
+ ln -sf $(outdir)/$(LIB_PREFIX)$(NAME).so.$(VERSION) $@.$(MAJOR_VERSION)
+ ln -sf $(LIB_PREFIX)$(NAME).so.$(VERSION) $@
+
#
lib: $(LIBRARY)
#
-clean:
- rm -f $(allexe) core $(allobs) $(alldeps)
- for i in $(SUBDIRS); do $(MAKE) -C $$i clean; done
-distclean: clean
- rm -rf $(lily-version) $(flower-version) $(mi2mu-version) .b $(build) *~ $(allout) $(allgen)
+outdirs: outdir
+ $(LOOP)
+
+outdir:
+ -mkdir $(outdir)
+
+# be careful about deletion.
+clean: localclean
+ -rm -f $(outdir)/*
+ touch $(outdir)/dummy.dep
+ $(LOOP)
+
+distclean: clean
+ $(LOOP)
+ $(MAKE) local-distclean
+
+maintainerclean:
+ $(LOOP)
+ $(MAKE) local-maintainerclean
+ $(MAKE) local-distclean
+
# configure:
# dummydeps:
#
-dummydep: $(flower-dir)/$(genout) $(lib-dir)/$(genout) $(lily-dir)/$(genout) $(mi2mu-dir)/$(genout) $(DUMMYDEPS)
+dummydep: $(DUMMYDEPS)
#
-# value of $(OSTYPE) on windhoos; "make $OSTYPE" if you use bash :-)
+# value of $(OSTYPE) on windhoos...; "make $OSTYPE" if you use bash :-)
#
-win32:
- $(MAKE) -C . CXX=g++
+win32: windows32 # win/lose?
+#
+windows32:
+ $(MAKE) -C . "CXX=g++ -D_WINDOWS32"
#
# 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"
+ $(MAKE) -C . CXX="gcc-go32 -I/usr/i386-go32/include -I/usr/i386-go32/include/g++ -D_WINDOWS32 -Dcaddr_t=char* -DMAP_SHARED=0"
#
# target help:
#
help:
+ @echo "Makefile for LilyPond $(TOPLEVEL_VERSION)"
@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 " exe help lib TAGS"
@echo " dos: xcomplile to dos"
- @echo " win32: native cygnus-win32 compile"
+ @echo " windows32: native cygnus-gnu compile"
#
doc:
- $(MAKE) -C Documentation do-doc
+ $(MAKE) -C $(depth)/Documentation do-doc
-# doc++ documentation of classes
-doc++: $(progdocs)
- doc++ -kp -d $(DOCDIR) $^
+# ugh. should generate in out/
dist:
+ rm -rf $(distdir)
-mkdir $(distdir)
$(MAKE) localdist
- (cd ./$(depth); tar cfz $(DIST_NAME).tar.gz $(DIST_NAME))
- rm -rf $(distdir)/ # should be trapped
+ chmod -R a+r $(distdir)
+ chmod a+x `find $(distdir) -type d -print`
-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
+ (cd ./$(depth)/$(outdir); $(TAR) cf - $(DIST_NAME) | gzip -9 > $(DIST_NAME).tar.gz)
-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
+# should be trapped
+ rm -rf $(distdir)/
-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
+# ugh. should generate in out/
+dozedist: doosdist
+doosdist:
+ -mkdir $(distdir)
+# nogo, SUBDIRS is handed down to subdir...
+# $(MAKE) SUBDIRS="Documentation init input tex" localdist
+ $(MAKE) localdist
+ chmod -Rf a+rX $(distdir)
+# ugh, the ugly way, then
+ (cd $(distdir); rm -rf $(NO_DOOS_DIST))
+ cp $(lilyout)/lilypond.exe $(distdir)
+ strip -s $(distdir)/lilypond.exe
+ cp $(mi2muout)/mi2mu.exe $(distdir)
+ strip -s $(distdir)/mi2mu.exe
+ (cd ./$(depth); $(ZIP) $(DIST_NAME).exe.zip $(distdir))
+# should be trapped
+ rm -rf $(distdir)/
+
+
+localdist: $(DISTFILES) $(OUT_DISTFILES)
+ touch $(outdir)/dummy.dep; \
+ mkdir $(distdir)/$(localdir)/out; \
+ $(LN) $(DISTFILES) $(distdir)/$(localdir)
+ $(LN) $(outdir)/dummy.dep $(OUT_DISTFILES) $(distdir)/$(localdir)/out
+ifdef SUBDIRS
+ set -e; for i in $(SUBDIRS); do mkdir $(distdir)/$(localdir)/$$i; \
+ $(MAKE) localdir=$(localdir)/$$i -C $$i localdist; done
+endif
+
+
+TAGS:$(all-tag-sources)
+ifdef all-tag-sources
+ -etags -CT $(all-tag-sources) $(ERROR_LOG)
+ -ctags -CT $(all-tag-sources) $(ERROR_LOG)
+endif
+ $(LOOP)
-all-tags: TAGS
- for i in $(SUBDIRS); do $(MAKE) -C $$i all-tags; done
-TAGS: $(allcc)
- etags -CT $(allcc)
+# version stuff:
+#
-# to some outdir?
-autoconf:
- autoconf - < configure.in > ac_configure
+$(outdir)/version.hh: VERSION
+ sh ./$(lily_bindir)/make-version.sh > $@
-# version stuff:
+# should this be in Rules?
+configure: configure.in aclocal.m4
+ autoconf - < $<> $@
+ chmod +x configure
+
+localclean:
+
+local-distclean:
+
+local-maintainerclean:
+
+install-strip:
+ $(MAKE) INSTALL="$(INSTALL) -s" install
+
+install: localinstall
+ $(LOOP)
+
+localinstall:
+
+uninstall: localuninstall
+ $(LOOP)
+
+localuninstall:
+
+# specific stuff:
#
-check-flower-version:
- $(MAKE) flower-version -C ./$(depth)/flower
-$(lily-version): $(lily-dir)/$(genout) ./$(depth)/.version ./$(bindir)/make_version $(build)
- ./$(bindir)/make_version "$(MAJOR_VERSION)" "$(MINOR_VERSION)" "$(PATCH_LEVEL)" "$(MY_PATCH_LEVEL)" "$(BUILD)" "$(CXX) $(CXXVER)" > $@
-check-mi2mu-version:
- $(MAKE) mi2mu-version -C ./$(depth)/mi2mu
+$(LIBFLOWER): check-flower-deps
+
+check-flower-deps:
+ $(MAKE) -C $(depth)/flower/ default
+
+check-lib-deps: check-flower-deps
+ $(MAKE) -C $(depth)/lib
+
+check-doc-deps:
+ $(MAKE) -C $(depth)/Documentation
+
+$(LIBLILY): dummy
+ $(MAKE) ./$(outdir)/$(@F) -C $(depth)/lib
+
+
+# RedHat rpm package:
#
+rpm: check-rpm-doc-deps
+ -cp $(depth)/lilypond-$(TOPLEVEL_VERSION).tar.gz $(rpm-sources)
+# -cp $(wildcard $(depth)/Documentation/*.xpm) $(rpm-sources)
+ -cp $(wildcard $(depth)/Documentation/$(outdir)/*.gif) $(rpm-sources)
+ $(MAKE) -C $(make-dir) spec
+ rpm -ba $(makeout)/lilypond.spec
+
+check-rpm-doc-deps:
+ $(MAKE) -C $(depth)/Documentation gifs
+
+check-mf-deps:
+ $(MAKE) -C $(depth)/mf
+
+$(configheader): $(depth)/$(configuration).hh
+ cp $< $@
+
+
+ifneq ($(DEPFILES),)
+include $(DEPFILES)
+endif