Makefile 6.47 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

sof's avatar
sof committed
13
14
15
16
17
18
#
# Totally evil hack to make the setting of SUBDIRS be dependent
# on whether we do `make install' or not. Having a $(ifeq ... ) would
# be preferable..
CURRENT_TARGET = $@
SUBDIRS = $(shell if (test x$(CURRENT_TARGET) = xinstall) ; then echo $(ProjectsToInstall); else echo $(ProjectsToBuild); fi)
19

20
21
22
#
# Files to include in fptools source distribution
#
sof's avatar
sof committed
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
25

26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#
# 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 \
sof's avatar
sof committed
41
	      README \
42
	      distrib/INSTALL \
sof's avatar
sof committed
43
44
	      ANNOUNCE \
	      ghc/PATCHLEVEL \
sof's avatar
sof committed
45
46
47
48
49
	      glafp-utils/mkdirhier/mkdirhier \
	      ghc/RELEASE \
	      install-sh \
	      config.guess \
	      config.sub
50
51
52

binary-dist::
	@for i in $(BIN_DIST_TOP); do \
sof's avatar
sof committed
53
54
	  echo cp $$i $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME); \
	  cp $$i $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME); \
55
	done;
sof's avatar
sof committed
56
57
58
59
	@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
60
	#-(cd $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME); autoconf )
61
62
63

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

#
# 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 \
sof's avatar
sof committed
126
		datadir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/share/ghc-$(ProjectVersion) ;
sof's avatar
sof committed
127
128
129
130
131
132
133
134
135
136
137

# 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
138
139
140
141
142

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

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