#
# project LilyPond -- the musical typesetter
-# title generic make rules
-# file make/Rules.make
+# title generic make targets
+# file make/Targets.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
+.PHONY : all clean config default dist doc doc++ dummy exe help lib TAGS html
# target all:
#
all: default
- for i in $(SUBDIRS); do $(MAKE) -C $$i all; done
+ifdef SUBDIRS
+ set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i all; done
+endif
+
+#
+
+# platform specific variables,
#
+include ./$(depth)/make/out/Site.make
+#
+
+# where to do this ?
+.PRECIOUS: $(makeout)/Site.make
# dependency list of executable:
#
-EXECUTABLE = $(bindir)/$(NAME)
-$(EXECUTABLE): $(OFILES) $(CUSTOMLIBES)
-# $(STRIPDEBUG) $(STABLEOBS)
-# $(LD_COMMAND) -o $@ $^ $(LOADLIBES)
- $(LD_COMMAND) $(OFILES) $(LOADLIBES)
- touch $(VERSION_DEPENDENCY)
+EXECUTABLE = $(lily_bindir)/$(NAME)
+$(EXECUTABLE): $(build) $(OFILES) $(MODULE_LIBDEPS)
$(INCREASE_BUILD)
- touch $(build) #waai necessary?
-#
+ $(MAKE) -S $(OFILES) $(SILENT_LOG)
+ifdef STABLEOBS
+ $(DO_STRIP) $(STABLEOBS)
+endif
+ $(LD_COMMAND) $(OFILES) $(LOADLIBES)
+
exe: $(EXECUTABLE)
#
+$(build): $(depth)/.version
+ echo 0 > $@
+
# dependency list of library:
#
-LIBRARY = $(libdir)/$(LIB_PREFIX)$(NAME)$(LIB_SUFFIX)
-$(LIBRARY): $(OFILES) $(CUSTOMLIBES)
+LIBRARY = $(outdir)/$(LIB_PREFIX)$(NAME).a
+$(LIBRARY): $(build) $(OFILES) $(MODULE_LIBDEPS)
+ $(INCREASE_BUILD)
+ $(MAKE) $(OFILES) $(SILENT_LOG)
$(AR_COMMAND) $(OFILES)
- touch $(VERSION_DEPENDENCY)
+ $(RANLIB_COMMAND)
+
+SHAREDLIBRARY=$(outdir)/$(LIB_PREFIX)$(NAME).so
+$(SHAREDLIBRARY): $(build) $(OFILES) $(MODULE_LIBDEPS)
$(INCREASE_BUILD)
- touch $(build) #waai necessary?
+ $(MAKE) $(OFILES) $(SILENT_LOG)
+ $(LD_COMMAND) $(OFILES) -o $@
+# ln -sf $(outdir)/$(LIB_PREFIX)$(NAME).so.$(VERSION) $(outdir)/$(LIB_PREFIX)$(NAME).so
#
lib: $(LIBRARY)
#
-clean:
- rm -f $(allexe) core $(allobs)
- for i in $(SUBDIRS); do $(MAKE) -C $$i clean; done
+clean: localclean
+ rm -f $(allobs) $(alldeps)
+ifdef SUBDIRS
+ set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean; done
+endif
-distclean: clean
- rm -rf $(lily-version) $(flower-version) .b $(build) .GENERATE *~ $(allout)
+distclean: localdistclean
+ifdef SUBDIRS
+ set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i localdistclean; done
+endif
+
+localdistclean:
# configure:
#
config:
- $(bindir)/configure
+ ./$(depth)/configure
+#
+
+# dummydeps:
+#
+dummydep: $(DUMMYDEPS)
#
# value of $(OSTYPE) on windhoos; "make $OSTYPE" if you use bash :-)
@echo
@echo "targets:"
@echo " all clean config dist distclean doc doc++"
- @echo " exe help lib moduledist tags"
+ @echo " exe help lib moduledist TAGS"
@echo " dos: xcomplile to dos"
@echo " win32: native cygnus-win32 compile"
#
doc:
- $(MAKE) -C Documentation do-doc
+ $(MAKE) -C $(depth)/Documentation do-doc
# doc++ documentation of classes
doc++: $(progdocs)
- doc++ -kp -d $(DOCDIR) $^
+ doc++ -k -p -d $(DOCDIR) $^
dist:
-mkdir $(distdir)
$(MAKE) localdist
+ chmod -Rf a+rX $(distdir)
+
(cd ./$(depth); tar cfz $(DIST_NAME).tar.gz $(DIST_NAME))
rm -rf $(distdir)/ # should be trapped
-localdist:
+localdist: $(DISTFILES)
+ if [ -d out ]; then mkdir $(distdir)/$(localdir)/out; fi
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
+ifdef SUBDIRS
+ set -e; for i in $(SUBDIRS); do mkdir $(distdir)/$(localdir)/$$i; \
+ $(MAKE) localdir=$(localdir)/$$i -C $$i localdist; done
+endif
moduledist:
-mkdir $(module-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
+ifdef SUBDIRS
+ set -e; for i in $(SUBDIRS); do mkdir $(module-distdir)/$(localdir)/$$i; done
+ set -e; for i in $(SUBDIRS); do $(MAKE) localdir=$(localdir)/$$i -C $$i localmoduledist; done
+endif
-all-tags: tags
- for i in $(SUBDIRS); do $(MAKE) -C $$i all-tags; done
+TAGS:$(all-tag-sources)
+ifdef all-tag-sources
+ -etags -CT $(all-tag-sources) /dev/null
+endif
+ifdef SUBDIRS
+ set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i TAGS ; done
+endif
-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)" > $@
+
+$(outdir)/version.hh: .version
+ ./$(lily_bindir)/make_version > $@
+
+
+# should this be in Rules?
+configure: configure.in
+ autoconf - < $<> $@
+ chmod +x configure
+
+localclean:
+
+
+install: localinstall
+ifdef SUBDIRS
+ set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install; done
+endif
+
+localinstall:
+
+uninstall: localuninstall
+ifdef SUBDIRS
+ set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i uninstall; done
+endif
+
+localuninstall:
+
+# specific stuff:
+#
+$(LIBFLOWER): check-flower-deps
+
+check-flower-deps:
+ $(MAKE) -C $(depth)/flower/ default
+
+check-lily-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: dist
+# mv ./$(depth)/lilypond-$(TOPLEVEL_VERSION).tar.gz $(rpm-sources)
+rpm:
+ make -C ./$(depth) dist
+ cp $(depth)/lilypond-$(TOPLEVEL_VERSION).tar.gz $(rpm-sources)
+ cp $(doc-dir)/*.gif $(rpm-sources)
+ $(MAKE) -C $(make-dir) spec
+ rpm -ba $(makeout)/lilypond.spec
#