X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=mk%2Ftarget.mk;h=2aaf39a25723aa24fbd9349e8dd88c258b8898aa;hb=cb7a5414a2414df673c33633076816d1c62afc3e;hp=667cdc8ceeacf7324d398813dec9fe8d4891adce;hpb=9ee95af6cdcc146c4b5e4822e27b05475bdabaec;p=ghc-hetmet.git diff --git a/mk/target.mk b/mk/target.mk index 667cdc8..2aaf39a 100644 --- a/mk/target.mk +++ b/mk/target.mk @@ -79,7 +79,14 @@ ifneq "$(SUBDIRS)" "" -all docs runtests boot TAGS clean distclean mostlyclean maintainer-clean install html ps dvi txt:: +# we override the boot & all targets in the top level Makefile +ifneq "$(NO_ALL_TARGETS)" "YES" +ALL = all +BOOT = boot +INSTALL = install +endif + +$(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)" @@ -352,19 +359,23 @@ SRC_HC_OPTS += -split-objs define BUILD_LIB $(RM) $@ -( echo $(STUBOBJS) ; $(FIND) $(patsubst %.$(way_)o,%,$(LIBOBJS)) -name '*.$(way_)o' -print ) | xargs ar q $@ +(echo $(STUBOBJS); $(FIND) $(patsubst %.$(way_)o,%,$(LIBOBJS)) -name '*.$(way_)o') | xargs ar q $@ $(RANLIB) $@ endef # 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 $@ +HC_SPLIT_PRE = \ + $(RM) $@; if [ ! -d $(basename $@) ]; then mkdir $(basename $@); else \ + $(FIND) $(basename $@) -name '*.$(way_)o' | xargs $(RM) __rm_food; fi +ifeq "$(GhcWithInterpreter)" "YES" +HC_SPLIT_POST = ld -r -x -o $@ $(basename $@)/*.$(way_)o +else +HC_SPLIT_POST = touch $@ +endif -SRC_HC_PRE_OPTS += $(HC_SPLIT_PRE) ; -SRC_HC_POST_OPTS += $(HC_SPLIT_POST) ; +SRC_HC_PRE_OPTS += $(HC_SPLIT_PRE); +SRC_HC_POST_OPTS += $(HC_SPLIT_POST); # # If (Haskell) object files are split, cleaning up @@ -414,13 +425,8 @@ ifeq "$(GHCI_LIBOBJS)" "" GHCI_LIBOBJS = $(LIBOBJS) endif -ifeq "$(SplitObjs)" "YES" -$(GHCI_LIBRARY) :: $(GHCI_LIBOBJS) - ( echo $(STUBOBJS) ; $(FIND) $(patsubst %.$(way_)o,%,$(LIBOBJS)) -name '*.$(way_)o' -print ) | xargs ld -r -x -o $@ -else $(GHCI_LIBRARY) :: $(GHCI_LIBOBJS) - ld -r -x -o $@ $(GHCI_LIBOBJS) -endif + ld -r -x -o $@ $(GHCI_LIBOBJS) $(STUBOBJS) CLEAN_FILES += $(GHCI_LIBRARY) endif @@ -619,7 +625,9 @@ endif ifneq "$(SCRIPT_PREFIX_FILES)" "" @cat $(SCRIPT_PREFIX_FILES) >> $@ endif +ifneq "$(SCRIPT_SUBST)" "" @eval $(SCRIPT_SUBST) +endif @cat $(SCRIPT_OBJS) >> $@ @chmod a+x $@ @echo Done. @@ -919,17 +927,9 @@ ifneq "$(SGML_DOC)" "" # multi-file SGML document: main document name is specified in $(SGML_DOC), # sub-documents (.sgml files) listed in $(SGML_SRCS). -ifeq "$(VSGML_SRCS)" "" -VSGML_SRCS = $(wildcard *.vsgml) -endif - ifeq "$(SGML_SRCS)" "" -ifneq "$(VSGML_SRCS)" "" -SGML_SRCS = $(patsubst %.vsgml, %.sgml, $(VSGML_SRCS)) -else SGML_SRCS = $(wildcard *.sgml) endif -endif SGML_TEX = $(addsuffix .tex,$(SGML_DOC)) SGML_DVI = $(addsuffix .dvi,$(SGML_DOC)) @@ -951,7 +951,6 @@ txt :: $(SGML_TEXT) CLEAN_FILES += $(SGML_TEXT) $(SGML_TEX) $(SGML_PS) $(SGML_DVI) $(SGML_PDF) $(SGML_RTF) $(SGML_HTML) $(SGML_DOC)-*.html # can't use $(SGML_SRCS) here, it was maybe used elsewhere -MOSTLY_CLEAN_FILES += $(patsubst %.vsgml, %.sgml, $(VSGML_SRCS)) extraclean :: $(RM) -rf DBTOHTML_OUTPUT_*