Makefile 5.57 KB
Newer Older
1 2 3 4 5 6 7
#################################################################################
#
#			fptools/Makefile
#
#		This is the main Makefile for fptools.
#
#################################################################################
8

9 10 11
TOP=.
include $(TOP)/mk/boilerplate.mk
SRC_DIST_DIR=$(shell pwd)/$(SRC_DIST_NAME)
12

13
SUBDIRS = $(ProjectsToBuild)
14

15 16 17 18 19
#
# Files to include in fptools source distribution
#
SRC_DIST_DIRS += mk $(ProjectsToBuild)
SRC_DIST_FILES += configure.in config.guess config.sub configure README ANNOUNCE NEWS INSTALL Makefile
20 21


22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
#
# Making a binary distribution
#
BIN_DIST_TMPDIR=$(shell pwd)
BIN_DIST_NAME=fptools

#
# list of toplevel `projects' to include in binary distrib.
#
BIN_DIST_DIRS=ghc

binary-dist:: binary-dist-pre

BIN_DIST_TOP= distrib/Makefile-bin.in \
	      distrib/configure-bin.in \
	      distrib/README \
	      distrib/INSTALL \
sof's avatar
sof committed
39 40 41 42 43 44 45
	      distrib/ANNOUNCE \
	      distrib/PATCHLEVEL \
	      glafp-utils/mkdirhier/mkdirhier \
	      ghc/RELEASE \
	      install-sh \
	      config.guess \
	      config.sub
46 47 48

binary-dist::
	@for i in $(BIN_DIST_TOP); do \
sof's avatar
sof committed
49 50
	  echo cp $$i $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME); \
	  cp $$i $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME); \
51
	done;
sof's avatar
sof committed
52 53 54 55
	@echo "hackily rename some of these chaps.."
	$(MV) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/Makefile-bin.in $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/Makefile.in 
	$(MV) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/configure-bin.in $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/configure.in 
	@echo "Generating a shippable configure script.."
sof's avatar
sof committed
56
	#-(cd $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME); autoconf )
57 58 59

#
# Creating and copying the documentation into the bin-dist tree.
sof's avatar
sof committed
60 61 62 63
# (this tries to be oh-so-general about copyng docs, but isn't really
# suited for anything else than ghc/)
#
# Needless to say, the rule below could be cleaned up somewhat.
64 65
#
binary-dist::
sof's avatar
sof committed
66 67 68
	@$(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/html/ghc-2.02
	@$(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/dvi/ghc-2.02
	@$(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/info/ghc-2.02
69
	@echo "Making html documentation.."
sof's avatar
sof committed
70
	@echo "For fptools.."
sof's avatar
sof committed
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
	#$(MAKE) -C docs --no-print-directory $(MFLAGS) html
	#cp -f docs/html/* docs/*.html $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/html/ghc-2.02
	#@echo "Done."
	#@for i in $(BIN_DIST_DIRS); do \
	#   echo "For $$i.."; \
	#   echo cp -f $$i/docs/users_guide/html/* $$i/docs/users_guide/*.html $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/html/ghc-2.02; \
	#   cp -f $$i/docs/users_guide/html/* $$i/docs/users_guide/*.html $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/html/ghc-2.02; \
	#   echo cp -f $$i/docs/html/* $$i/docs/*.html $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/html/ghc-2.02; \
	#   cp -f $$i/docs/html/* $$i/docs/*.html $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/html/ghc-2.02; \
	#   echo "Done."; \
	#done
	##@echo "Making dvi files.."
	#@echo "For fptools.."
	#-$(MAKE) -C docs --no-print-directory $(MFLAGS) dvi
	#-cp -f docs/*.dvi  $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/dvi/ghc-2.02
	#@echo "Done."
	#@for i in $(BIN_DIST_DIRS); do \
	#   echo "For $$i.."; \
	#   echo cp -f $$i/docs/users_guide/*.dvi $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/dvi/ghc-2.02; \
	#   cp -f $$i/docs/users_guide/*.dvi $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/dvi/ghc-2.02; \
	#   echo cp -f $$i/docs/*.dvi $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/dvi/ghc-2.02; \
	#   cp -f $$i/docs/*.dvi $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/dvi/ghc-2.02; \
	#   echo "Done."; \
	#done
	#@echo "Making info files.."
	#@echo "For fptools.."
	#-$(MAKE) -C docs --no-print-directory $(MFLAGS) info
	#-cp -f docs/*.info $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/info/ghc-2.02/
	#@echo "Done."
	#@for i in $(BIN_DIST_DIRS); do \
	#   echo "For $$i docs.."; \
	#   echo cp -f $$i/docs/users_guide/*.info  $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/info/ghc-2.02; \
	#   cp -f $$i/docs/users_guide/*.info $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/info/ghc-2.02; \
	#   echo cp -f $$i/docs/*.info $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/info/ghc-2.02; \
	#   cp -f $$i/docs/*.info $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/info/ghc-2.02; \
	#   echo "Done."; \
	#done
sof's avatar
sof committed
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133

#
# binary dist'ing hslibs/, hackily.
#
binary-dist ::
	@echo $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/ghc-$(ProjectVersion)/hslibs;
	@$(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/ghc-$(ProjectVersion)/hslibs;
	$(MAKE) -C hslibs $(MFLAGS) install \
		BIN_DIST=1 BIN_DIST_NAME=$(BIN_DIST_NAME) \
		prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) \
		exec_prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) \
		bindir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM)/ghc-$(ProjectVersion) \
		libdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/ghc-$(ProjectVersion)/hslibs \
		libexecdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/ghc-$(ProjectVersion)/hslibs \
		datadir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/share/$$i-$(ProjectVersion) ;

# Even more of a hack, but I'm too tired to fix this up right now..
BIN_DIST_SCRIPTS_NEEDING_RENAMING=ghc stat2resid hstags mkdependHS

binary-dist::
	@for i in $(BIN_DIST_SCRIPTS_NEEDING_RENAMING); do \
	     echo "Renaming $$i to $$i.prl"; \
	    $(MV) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM)/ghc-$(ProjectVersion)/$$i  $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM)/ghc-$(ProjectVersion)/$$i.prl; \
	done
	@echo "Renaming hscpp to hscpp.prl"
	@$(MV) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/ghc-$(ProjectVersion)/hscpp  $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/ghc-$(ProjectVersion)/hscpp.prl
134 135 136 137 138

dist :: dist-pre
include $(TOP)/mk/target.mk
dist :: dist-post

sof's avatar
sof committed
139 140
binary-dist::
	@echo "Mechanical and super-natty! Inspect the result and *if* happy; freeze, sell and get some sleep!"