# install* uninstall installcheck installdirs
# clean* distclean* mostlyclean* maintainer-clean*
# tags*
-# info dvi ps
+# dvi ps (no info) FPTOOLS adds: pdf rtf html
# dist binary-dist
# check
#
ifneq "$(SUBDIRS)" ""
-all docs runtests boot TAGS clean veryclean maintainer-clean install info html ps dvi txt::
+all docs runtests boot TAGS clean distclean mostlyclean maintainer-clean install html ps dvi txt::
@echo "------------------------------------------------------------------------"
@echo "===fptools== Recursively making \`$@' in $(SUBDIRS) ..."
@echo "PWD = $(shell pwd)"
$(MAKE) -C $@ $(MFLAGS)
endif
-ifneq "$(WAYS)" ""
-ifeq "$(way)" ""
-
-# NB: the targets exclude
-# boot info TAGS runtests
-# since these are way-independent
-all docs TAGS clean veryclean maintainer-clean install ::
- @echo "------------------------------------------------------------------------"
- @echo "===fptools== Recursively making \`$@' for ways: $(WAYS) ..."
- @echo "PWD = $(shell pwd)"
- @echo "------------------------------------------------------------------------"
-# Don't rely on -e working, instead we check exit return codes from sub-makes.
- @case '${MFLAGS}' in *-[ik]*) x_on_err=0;; *-r*[ik]*) x_on_err=0;; *) x_on_err=1;; esac; \
- for i in $(WAYS) ; do \
- echo "------------------------------------------------------------------------"; \
- echo "==fptools== $(MAKE) way=$$i $@;"; \
- echo "PWD = $(shell pwd)"; \
- echo "------------------------------------------------------------------------"; \
- $(MAKE) way=$$i --no-print-directory $(MFLAGS) $@ ; \
- if [ $$? -eq 0 ] ; then true; else exit $$x_on_err; fi; \
- done
- @echo "------------------------------------------------------------------------"
- @echo "===fptools== Finished recursively making \`$@' for ways: $(WAYS) ..."
- @echo "PWD = $(shell pwd)"
- @echo "------------------------------------------------------------------------"
-
-endif
-endif
-
##################################################################
# FPtools standard targets
#
$(MKDEPENDC) -f .depend $(MKDEPENDC_OPTS) $(foreach way,$(WAYS),-s $(way)) -- $(CC_OPTS) -- $(MKDEPENDC_SRCS)
endif
ifneq "$(MKDEPENDHS_SRCS)" ""
- $(MKDEPENDHS) -M -optdep-f -optdep.depend $(foreach way,$(WAYS),-optdep-s -optdep$(way)) $(foreach obj,$(MKDEPENDHS_OBJ_SUFFICES),-optdep-o -optdep$(obj)) $(MKDEPENDHS_OPTS) $(HC_OPTS) $(MKDEPENDHS_SRCS)
+ $(MKDEPENDHS) -M -optdep-f -optdep.depend $(foreach way,$(WAYS),-optdep-s -optdep$(way)) $(foreach obj,$(MKDEPENDHS_OBJ_SUFFICES),-osuf $(obj)) $(MKDEPENDHS_OPTS) $(HC_OPTS) $(MKDEPENDHS_SRCS)
endif
#
# `all'
# Compile the entire program. This should be the default target.
-# This target need not rebuild any documentation files; Info files
-# should normally be included in the distribution, and DVI files
-# should be made only when explicitly asked for.
+# This target need not rebuild any documentation files
#
# `install'
# Compile the program and copy the executables, libraries, and so on
# will ignore any errors. This is in case there are systems that
# don't have the Unix man page documentation system installed.
#
-# The way to install Info files is to copy them into `$(infodir)'
-# with $(INSTALL_DATA) (see Command Variables), and then run the
-# install-info program if it is present. install-info is a script
-# that edits the Info `dir' file to add or update the menu entry for
-# the given Info file; it will be part of the Texinfo package. Here
-# is a sample rule to install an Info file:
-#
-# $(infodir)/foo.info: foo.info # There may be a newer info
-# file in . than in srcdir.
-# -if test -f foo.info; then d=.; \
-# else d=$(srcdir); fi; \ $(INSTALL_DATA)
-# $$d/foo.info $@; \ # Run install-info only if it
-# exists. # Use `if' instead of just prepending `-' to the
-# # line so we notice real errors from install-info. # We
-# use `$(SHELL) -c' because some shells do not # fail
-# gracefully when there is an unknown command.
-# if $(SHELL) -c 'install-info --version' \
-# >/dev/null 2>&1; then \ install-info
-# --infodir=$(infodir) $$d/foo.info; \ else true;
-# fi
-#
# `uninstall'
# Delete all the installed files that the `install' target would
# create (but not the noninstalled files such as `make all' would
# Delete everything from the current directory that can be
# reconstructed with this Makefile. This typically includes
# everything deleted by distclean , plus more: C source files
-# produced by Bison, tags tables, Info files, and so on.
+# produced by Bison, tags tables, and so on.
#
# One exception, however: `make maintainer-clean' should not delete
# `configure' even if `configure' can be remade using a rule in the
# `TAGS'
# Update a tags table for this program.
#
-# `info'
-# Generate any Info files needed. The best way to write the rules is
-# as follows:
-#
-# info: foo.info
-#
-# foo.info: foo.texi chap1.texi chap2.texi
-# $(MAKEINFO) $(srcdir)/foo.texi
-#
-# You must define the variable MAKEINFO in the Makefile. It should
-# run the makeinfo program, which is part of the Texinfo
-# distribution.
-#
-# `dvi' `ps'
-# Generate DVI files for all TeXinfo documentation. For example:
-#
-# dvi: foo.dvi
-#
-# foo.dvi: foo.texi chap1.texi chap2.texi
-# $(TEXI2DVI) $(srcdir)/foo.texi
-#
-# You must define the variable TEXI2DVI in the Makefile. It should
-# run the program texi2dvi , which is part of the Texinfo
-# distribution. Alternatively, write just the dependencies, and
-# allow GNU Make to provide the command.
+# `dvi' `ps' `pdf' `html' `pdf'
+# Generate DVI/PS/PDF files for LaTeX/DocBook docs. Not everything is
+# supported everywhere, but the intention is to standardise on DocBook
+# producing all formats.
#
-# ps is a FPtools addition for Postscript files
-#
# `dist' `binary-dist'
# Create a distribution tar file for this program. The tar file
# should be set up so that the file names in the tar file start with
# a subdirectory name which is the name of the package it is a
# distribution for. This name can include the version number.
-#
+#
# For example, the distribution tar file of GCC version 1.40 unpacks
# into a subdirectory named `gcc-1.40'.
#
define BUILD_LIB
$(RM) $@
-$(AR) $(AR_OPTS) $@ $(LIBOBJS)
+$(AR) $(AR_OPTS) $@ $(STUBOBJS) $(LIBOBJS)
$(RANLIB) $@
endef
ifneq "$(HS_SRCS)" ""
ifeq "$(SplitObjs)" "YES"
+
+SRC_HC_OPTS += -split-objs
+
define BUILD_LIB
$(RM) $@
-TMPDIR=$(TMPDIR); export TMPDIR; $(FIND) $(patsubst %.$(way_)o,%,$(LIBOBJS)) -name '*.$(way_)o' -print | xargs ar q $@
+( echo $(STUBOBJS) ; $(FIND) $(patsubst %.$(way_)o,%,$(LIBOBJS)) -name '*.$(way_)o' -print ) | xargs ar q $@
$(RANLIB) $@
endef
-endif # $(filter...
-endif
+
+# Extra stuff for compiling Haskell files with $(SplitObjs):
+
+HC_SPLIT_PRE= \
+ $(RM) $@ ; if [ ! -d $(basename $@) ]; then mkdir $(basename $@); else \
+ $(FIND) $(basename $@) -name '*.$(way_)o' -print | xargs $(RM) __rm_food ; fi
+HC_SPLIT_POST = touch $@
+
+SRC_HC_PRE_OPTS += $(HC_SPLIT_PRE) ;
+SRC_HC_POST_OPTS += $(HC_SPLIT_POST) ;
+
+#
+# If (Haskell) object files are split, cleaning up
+# consist of descending into the directories where
+# the myriads of object files have been put.
+#
+
+extraclean ::
+ $(FIND) $(patsubst %.$(way_)o,%,$(HS_OBJS)) -name '*.$(way_)o' -print | xargs $(RM) __rm_food
+ -rmdir $(patsubst %.$(way_)o,%,$(HS_OBJS)) > /dev/null 2>&1
+
+endif # $(SplitObjs)
+endif # $(HS_SRCS)
#
# Remove local symbols from library objects if requested.
endif
endif
-$(LIBRARY) :: $(LIBOBJS)
+$(LIBRARY) :: $(STUBOBJS) $(LIBOBJS)
$(BUILD_LIB)
endif
DLL_NAME = $(patsubst %.a, %.dll, $(subst lib,,$(LIBRARY)))
endif
+ifneq "$(DLL_NAME)" ""
+DLL_NAME := $(DLL_PEN)/$(DLL_NAME)
+endif
+
all :: $(DLL_NAME)
ifeq "$(DLL_IMPLIB_NAME)" ""
###########################################
#
-# Targets: check tags show info
+# Targets: check tags show
#
###########################################
endif
endif
-SGML_TEX = $(SGML_DOC).tex
-SGML_DVI = $(SGML_DOC).dvi
-SGML_PS = $(SGML_DOC).ps
-SGML_PDF = $(SGML_DOC).pdf
-SGML_RTF = $(SGML_DOC).rtf
-SGML_HTML = $(SGML_DOC).html
+SGML_TEX = $(addsuffix .tex,$(SGML_DOC))
+SGML_DVI = $(addsuffix .dvi,$(SGML_DOC))
+SGML_PS = $(addsuffix .ps,$(SGML_DOC))
+SGML_PDF = $(addsuffix .pdf,$(SGML_DOC))
+SGML_RTF = $(addsuffix .rtf,$(SGML_DOC))
+SGML_HTML = $(addsuffix .html,$(SGML_DOC))
# HTML output goes in a subdirectory on its own.
-SGML_TEXT = $(SGML_DOC).txt
+SGML_TEXT = $(addsuffix .txt,$(SGML_DOC))
-$(SGML_DVI) $(SGML_PS) $(SGML_INFO) $(SGML_HTML) $(SGML_TEXT) :: $(SGML_SRCS)
+$(SGML_DVI) $(SGML_PS) $(SGML_HTML) $(SGML_TEXT) :: $(SGML_SRCS)
dvi :: $(SGML_DVI)
ps :: $(SGML_PS)
# can't use $(SGML_SRCS) here, it was maybe used elsewhere
MOSTLY_CLEAN_FILES += $(patsubst %.vsgml, %.sgml, $(VSGML_SRCS))
-clean ::
+extraclean ::
$(RM) -rf $(SGML_DOC)
endif
#
###########################################
-.PHONY: realclean mostlyclean clean distclean maintainer-clean
-
-# realclean is just a synonym for maintainer-clean
-realclean: maintainer-clean
+# we have to be careful about recursion here; since all the clean
+# targets are recursive, we don't want to make eg. distclean depend on
+# clean because that would result in far too many recursive calls.
+.PHONY: mostlyclean clean distclean maintainer-clean
-ifneq "$(MOSTLY_CLEAN_FILES)" ""
mostlyclean::
rm -f $(MOSTLY_CLEAN_FILES)
-endif
-
-ifneq "$(CLEAN_FILES)" ""
-clean:: mostlyclean
- rm -f $(CLEAN_FILES)
-endif
+# extraclean is used for adding actions to the clean target.
+extraclean::
-ifneq "$(DIST_CLEAN_FILES)" ""
-distclean:: mostlyclean clean
- rm -f $(DIST_CLEAN_FILES)
-endif
+clean:: extraclean
+ rm -f $(MOSTLY_CLEAN_FILES) $(CLEAN_FILES)
+distclean:: extraclean
+ rm -f $(MOSTLY_CLEAN_FILES) $(CLEAN_FILES) $(DIST_CLEAN_FILES)
-ifneq "$(MAINTAINER_CLEAN_FILES)" ""
-maintainer-clean:: mostlyclean clean distclean
+maintainer-clean:: extraclean
@echo 'This command is intended for maintainers to use; it'
@echo 'deletes files that may need special tools to rebuild.'
- rm -f $(MAINTAINER_CLEAN_FILES)
-endif
-
-#
-# If (Haskell) object files are split, cleaning up
-# consist of descending into the directories where
-# the myriads of object files have been put.
-#
-
-ifneq "$(HS_OBJS)" ""
-ifneq "$(filter -split-objs,$(HC_OPTS))" ""
-clean ::
- $(FIND) $(patsubst %.$(way_)o,%,$(HS_OBJS)) -name '*.$(way_)o' -print | xargs $(RM) __rm_food
- -rmdir $(patsubst %.$(way_)o,%,$(HS_OBJS)) > /dev/null 2>&1
-endif
-endif
-
+ rm -f $(MOSTLY_CLEAN_FILES) $(CLEAN_FILES) $(MAINTAINER_CLEAN_FILES)
#################################################################################
#
$(MAKE) $(MFLAGS) $@ way=$(subst .,,$(suffix $(subst _,.,$(basename $@))))
endif # if way
+
+ifneq "$(WAYS)" ""
+ifeq "$(way)" ""
+
+# NB: the targets exclude
+# boot runtests
+# since these are way-independent
+all docs TAGS clean distclean mostlyclean maintainer-clean install ::
+ @echo "------------------------------------------------------------------------"
+ @echo "===fptools== Recursively making \`$@' for ways: $(WAYS) ..."
+ @echo "PWD = $(shell pwd)"
+ @echo "------------------------------------------------------------------------"
+# Don't rely on -e working, instead we check exit return codes from sub-makes.
+ @case '${MFLAGS}' in *-[ik]*) x_on_err=0;; *-r*[ik]*) x_on_err=0;; *) x_on_err=1;; esac; \
+ for i in $(WAYS) ; do \
+ echo "------------------------------------------------------------------------"; \
+ echo "==fptools== $(MAKE) way=$$i $@;"; \
+ echo "PWD = $(shell pwd)"; \
+ echo "------------------------------------------------------------------------"; \
+ $(MAKE) way=$$i --no-print-directory $(MFLAGS) $@ ; \
+ if [ $$? -eq 0 ] ; then true; else exit $$x_on_err; fi; \
+ done
+ @echo "------------------------------------------------------------------------"
+ @echo "===fptools== Finished recursively making \`$@' for ways: $(WAYS) ..."
+ @echo "PWD = $(shell pwd)"
+ @echo "------------------------------------------------------------------------"
+
+endif
+endif