1 #################################################################################
5 # This is the main Makefile for fptools.
7 #################################################################################
10 include $(TOP)/mk/boilerplate.mk
11 SRC_DIST_DIR=$(shell pwd)/$(SRC_DIST_NAME)
14 # Totally evil hack to make the setting of SUBDIRS be dependent
15 # on whether we do `make install' or not. Having a $(ifeq ... ) would
18 SUBDIRS = $(shell if (test x$(CURRENT_TARGET) = xinstall) ; then echo $(ProjectsToInstall); else echo $(ProjectsToBuild); fi)
21 # Files to include in fptools source distribution
23 SRC_DIST_DIRS += mk docs CONTRIB distrib $(ProjectsToBuild)
24 SRC_DIST_FILES += configure.in config.guess config.sub configure aclocal.m4 README ANNOUNCE INSTALL Makefile install-sh
27 # Making a binary distribution
29 BIN_DIST_TMPDIR=$(shell pwd)
33 # list of toplevel `projects' to include in binary distrib.
37 binary-dist:: binary-dist-pre
39 BIN_DIST_TOP= distrib/Makefile-bin.in \
40 distrib/configure-bin.in \
45 glafp-utils/mkdirhier/mkdirhier \
52 @for i in $(BIN_DIST_TOP); do \
53 echo cp $$i $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME); \
54 cp $$i $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME); \
56 @echo "hackily rename some of these chaps.."
57 $(MV) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/Makefile-bin.in $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/Makefile.in
58 $(MV) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/configure-bin.in $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/configure.in
59 @echo "Generating a shippable configure script.."
60 #-(cd $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME); autoconf )
63 # binary dist'ing the documentation.
64 # Which documentation to build/install is hardcoded below.
67 BINDIST_DOCS = docs ghc/docs/users_guide
68 BINDIST_DOCS_WAYS = html info dvi
71 @for way in $(BINDIST_DOCS_WAYS); do \
72 $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/$$way/$(GhcProjectNameShort)-$(GhcProjectVersion); \
73 for dir in $(BINDIST_DOCS); do \
74 echo Making $$way documentation in $$dir; \
75 $(MAKE) -C $$dir --no-print-directory $(MFLAGS) $$way; \
76 echo cp -f $$dir/*.$$way $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/$$way/$(GhcProjectNameShort)-$(GhcProjectVersion); \
77 cp -f $$dir/*.$$way $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/$$way/$(GhcProjectNameShort)-$(GhcProjectVersion); \
83 # binary dist'ing hslibs/, hackily.
86 @echo $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/ghc-$(ProjectVersion)/hslibs;
87 @$(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/ghc-$(ProjectVersion)/hslibs;
88 $(MAKE) -C hslibs $(MFLAGS) install \
89 BIN_DIST=1 BIN_DIST_NAME=$(BIN_DIST_NAME) \
90 prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) \
91 exec_prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) \
92 bindir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM)/ghc-$(ProjectVersion) \
93 libdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/ghc-$(ProjectVersion)/hslibs \
94 libexecdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/ghc-$(ProjectVersion)/hslibs \
95 datadir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/share/ghc-$(ProjectVersion) ;
97 # Even more of a hack, but I'm too tired to fix this up right now..
98 BIN_DIST_SCRIPTS_NEEDING_RENAMING=ghc stat2resid hstags mkdependHS
101 @for i in $(BIN_DIST_SCRIPTS_NEEDING_RENAMING); do \
102 echo "Renaming $$i to $$i.prl"; \
103 $(MV) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM)/ghc-$(ProjectVersion)/$$i $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM)/ghc-$(ProjectVersion)/$$i.prl; \
105 @echo "Renaming hscpp to hscpp.prl"
106 @$(MV) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/ghc-$(ProjectVersion)/hscpp $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/ghc-$(ProjectVersion)/hscpp.prl
109 include $(TOP)/mk/target.mk
113 @echo "Mechanical and super-natty! Inspect the result and *if* happy; freeze, sell and get some sleep!"