Change CVS for _darcs in dirs to prune during make dist
[ghc.git] / Makefile
1 ############################################################################
2 #
3 # fptools/Makefile
4 #
5 # This is the main Makefile for fptools.
6 #
7 ############################################################################
8
9 TOP=.
10 include $(TOP)/mk/boilerplate.mk
11
12 # find the projects that actually exist...
13 ProjectsThatExist = $(filter $(patsubst %/, %, $(wildcard */)), $(AllProjects))
14
15 # and filter only those that the user requested, if necessary
16 ifeq "$(ProjectsToBuild)" ""
17 SUBDIRS = $(ProjectsThatExist)
18 else
19 SUBDIRS = $(filter $(ProjectsToBuild), $(ProjectsThatExist))
20 endif
21
22 ifneq "$(Project)" ""
23 ifeq "$(Project)" "GreenCard"
24 ProjectDirectory=greencard
25 else
26 ifeq "$(Project)" "HaskellDirect"
27 ProjectDirectory=hdirect
28 else
29 ProjectDirectory=$(Project)
30 endif
31 endif
32 -include $(shell echo $(ProjectDirectory) | tr A-Z a-z)/mk/config.mk
33 -include $(shell echo $(ProjectDirectory) | tr A-Z a-z)/mk/version.mk
34 endif
35
36 # -----------------------------------------------------------------------------
37 # Certain targets require that Project is set from the command line.
38
39 CURRENT_TARGET = $(MAKECMDGOALS)
40 project-check :
41 @if [ "$(Project)" = "" ]; then \
42 echo " You need to set \"Project\" in order to make $(CURRENT_TARGET)"; \
43 echo " eg. make $(CURRENT_TARGET) Project=Ghc"; \
44 exit 1; \
45 fi
46
47 # -----------------------------------------------------------------------------
48 # Targets: all, stage1, stage2, stage3
49
50 DIST_CLEAN_FILES += config.cache config.status mk/config.h mk/stamp-h
51
52 extraclean::
53 $(RM) -rf autom4te.cache
54
55 #
56 # If you've ended up using an in-place version of Happy,
57 # make sure it gets built early on.
58 #
59 ifeq "$(HAPPY)" "$(FPTOOLS_TOP_ABS)/happy/src/happy-inplace"
60 build :: $(FPTOOLS_TOP_ABS)/happy/src/happy-inplace
61
62 $(FPTOOLS_TOP_ABS)/happy/src/happy-inplace : glafp-utils
63 $(MAKE) -C happy boot all
64 endif
65
66 # Build all projects that we know about
67 build ::
68 @case '${MFLAGS}' in *-[ik]*) x_on_err=0;; *-r*[ik]*) x_on_err=0;; *) x_on_err=1;; esac; \
69 for i in $(SUBDIRS); do \
70 if [ -d $$i ]; then \
71 $(MAKE) -C $$i boot; \
72 if [ $$? -eq 0 -o $$x_on_err -eq 0 ] ; then true; else exit 1; fi; \
73 $(MAKE) -C $$i all; \
74 if [ $$? -eq 0 -o $$x_on_err -eq 0 ] ; then true; else exit 1; fi; \
75 fi; \
76 done
77
78 ifeq "$(findstring ghc, $(SUBDIRS))" "ghc"
79
80 .PHONY: stage1 stage2 stage3 bootstrap bootstrap2 bootstrap3
81
82 stage1 : build
83
84 stage2 :
85 $(MAKE) -C ghc/compiler boot stage=2
86 $(MAKE) -C ghc/compiler stage=2
87
88 stage3 :
89 $(MAKE) -C ghc/compiler boot stage=3
90 $(MAKE) -C ghc/compiler stage=3
91
92 bootstrap : bootstrap2
93
94 bootstrap2 : stage1
95 $(MAKE) stage2
96
97 bootstrap3 : bootstrap2
98 $(MAKE) stage3
99
100 all :: bootstrap
101
102 # We want to install the stage 2 bootstrapped compiler by default, but we let
103 # the user override this by saying 'make install stage=1', for example.
104 ifeq "$(stage)" ""
105 INSTALL_STAGE = stage=2
106 else
107 INSTALL_STAGE =
108 endif
109
110 else # Not building GHC
111
112 all :: build
113
114 INSTALL_STAGE =
115
116 endif
117
118 boot ::
119 @echo "Please use \`make all' only from the top-level, or \`make boot' followed"
120 @echo "by \`make all' in an individual project subdirectory (ghc, hslibs etc.)."
121
122 install ::
123 @case '${MFLAGS}' in *-[ik]*) x_on_err=0;; *-r*[ik]*) x_on_err=0;; *) x_on_err=1;; esac; \
124 for i in $(filter-out $(ProjectsDontInstall), $(SUBDIRS)); do \
125 if [ -d $$i ]; then \
126 $(MAKE) -C $$i $(INSTALL_STAGE) install; \
127 if [ $$? -eq 0 -o $$x_on_err -eq 0 ] ; then true; else exit 1; fi; \
128 fi; \
129 done
130
131 # If installing on Windows with MinGW32, copy the gcc compiler, headers and libs
132 # and the perl interpreter and dll into the GHC prefix directory.
133 # Gcc and Perl source locations derived from configuration data.
134 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
135 ifneq "$(WhatGccIsCalled)" ""
136 install ::
137 -mkdir $(prefix)/gcc-lib
138 -mkdir $(prefix)/include
139 -mkdir $(prefix)/include/mingw
140 -cp -rp $(GccDir)../include/* $(prefix)/include/mingw
141 -cp -rp $(GccDir)../lib/gcc-lib/mingw32/$(GccVersion)/* $(prefix)/gcc-lib
142 -cp $(GccDir)../lib/*.* $(prefix)/gcc-lib
143 -cp $(GccDir)gcc.exe $(prefix)
144 -cp $(GccDir)as.exe $(prefix)/gcc-lib
145 -cp $(GccDir)ld.exe $(prefix)/gcc-lib
146 -cp $(GccDir)dllwrap.exe $(prefix)/gcc-lib
147 -cp $(GccDir)dlltool.exe $(prefix)/gcc-lib
148 -cp $(GhcDir)../perl.exe $(prefix)
149 -cp $(GhcDir)../perl56.dll $(prefix)
150 endif
151 endif
152
153 install-docs ::
154 @case '${MFLAGS}' in *-[ik]*) x_on_err=0;; *-r*[ik]*) x_on_err=0;; *) x_on_err=1;; esac; \
155 for i in $(filter-out $(ProjectsDontInstall), $(SUBDIRS)); do \
156 if [ -d $$i ]; then \
157 $(MAKE) -C $$i $(INSTALL_STAGE) install-docs; \
158 if [ $$? -eq 0 -o $$x_on_err -eq 0 ] ; then true; else exit 1; fi; \
159 fi; \
160 done
161
162 # -----------------------------------------------------------------------------
163 # Making a binary distribution
164 #
165 # To make a particular binary distribution:
166 # set $(Project) to the name of the project, capitalised (eg. Ghc or Happy).
167
168 # `dist' `binary-dist'
169 # Create a distribution tar file for this program. The tar file
170 # should be set up so that the file names in the tar file start with
171 # a subdirectory name which is the name of the package it is a
172 # distribution for. This name can include the version number.
173 #
174 # For example, the distribution tar file of GCC version 1.40 unpacks
175 # into a subdirectory named `gcc-1.40'.
176 #
177 # The easiest way to do this is to create a subdirectory
178 # appropriately named, use ln or cp to install the proper files in
179 # it, and then tar that subdirectory.
180 #
181 # The dist target should explicitly depend on all non-source files
182 # that are in the distribution, to make sure they are up to date in
183 # the distribution. See Making Releases.
184 #
185 # binary-dist is an FPtools addition for binary distributions
186 #
187
188 binary-dist :: project-check
189
190 BIN_DIST_TMPDIR=$(FPTOOLS_TOP_ABS)
191 BIN_DIST_NAME=$(ProjectNameShort)-$(ProjectVersion)
192
193 #
194 # list of toplevel directories to include in binary distrib.
195 #
196 BIN_DIST_MAIN_DIR=$($(Project)MainDir)
197 BIN_DIST_DIRS=$($(Project)BinDistDirs)
198
199 binary-dist:: binary-dist-pre
200
201 BIN_DIST_TOP= distrib/Makefile-bin.in \
202 distrib/configure-bin.ac \
203 distrib/INSTALL \
204 $(BIN_DIST_MAIN_DIR)/ANNOUNCE \
205 $(BIN_DIST_MAIN_DIR)/VERSION \
206 $(BIN_DIST_MAIN_DIR)/LICENSE \
207 $(BIN_DIST_MAIN_DIR)/README \
208 glafp-utils/mkdirhier/mkdirhier \
209 install-sh \
210 config.guess \
211 config.sub \
212 aclocal.m4
213
214 ifeq "$(darwin_TARGET_OS)" "1"
215 BIN_DIST_TOP+=mk/fix_install_names.sh
216 endif
217
218 #
219 # binary-dist creates a binary bundle, set BIN_DIST_NAME
220 # to package name and do `make binary-dist Project=<project-name>'
221 # (normally this just a thing you would do from the toplevel of fptools)
222 #
223 .PHONY: binary-dist-pre binary-dist binary-pack
224
225 BIN_DIST_NAME=$(ProjectNameShort)-$(ProjectVersion)
226 BIN_DIST_TMPDIR=$(FPTOOLS_TOP_ABS)
227
228 binary-dist-pre::
229 ifeq "$(BIN_DIST)" ""
230 @echo "WARNING: To run the binary-dist target, you need to set BIN_DIST=1 in your build.mk" && exit 1
231 endif
232 -rm -rf $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)
233 -$(RM) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME).tar.gz
234 -echo "BIN_DIST_DIRS = $(BIN_DIST_DIRS)"
235 @for i in $(BIN_DIST_DIRS); do \
236 if test -d "$$i"; then \
237 echo $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM); \
238 $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM); \
239 echo $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM); \
240 $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM); \
241 echo $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/share; \
242 $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/share; \
243 echo $(MAKE) -C $$i $(MFLAGS) $(INSTALL_STAGE) install \
244 prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) \
245 exec_prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) \
246 bindir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM) \
247 libdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM) \
248 libexecdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM) \
249 datadir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/share; \
250 $(MAKE) -C $$i $(MFLAGS) $(INSTALL_STAGE) install \
251 prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) \
252 exec_prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) \
253 bindir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM) \
254 libdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM) \
255 libexecdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM) \
256 datadir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/share; \
257 fi; \
258 done
259
260 binary-dist::
261 @for i in $(BIN_DIST_TOP); do \
262 if test -f "$$i"; then \
263 echo cp $$i $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME); \
264 cp $$i $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME); \
265 fi; \
266 done;
267 @echo "Configuring the Makefile for this project..."
268 touch $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/Makefile.in
269 echo "package = $(ProjectNameShort)" >> $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/Makefile.in
270 echo "version = $(ProjectVersion)" >> $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/Makefile.in
271 echo "PACKAGE_SH_SCRIPTS = $($(Project)BinDistShScripts)" >> $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/Makefile.in
272 echo "PACKAGE_PRL_SCRIPTS = $($(Project)BinDistPrlScripts)" >> $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/Makefile.in
273 echo "PACKAGE_LIB_PRL_SCRIPTS = $($(Project)BinDistLibPrlScripts)" >> $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/Makefile.in
274 echo "PACKAGE_LIB_SPLICED_FILES = $($(Project)BinDistLibSplicedFiles)" >> $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/Makefile.in
275 echo "PACKAGE_BINS = $($(Project)BinDistBins)" >> $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/Makefile.in
276 echo "PACKAGE_OPT_BINS = $($(Project)BinDistOptBins)" >> $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/Makefile.in
277 echo "PACKAGE_LINKS = $($(Project)BinDistLinks)" >> $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/Makefile.in
278 cat $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/Makefile-bin.in >> $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/Makefile.in
279 @echo "Generating a shippable configure script.."
280 $(MV) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/configure-bin.ac $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/configure.ac
281 ( cd $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME); autoconf )
282 if test -x $(BIN_DIST_MAIN_DIR)/mk/post-install-script ; then \
283 cp $(BIN_DIST_MAIN_DIR)/mk/post-install-script \
284 $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) ; \
285 fi
286 if test -x $(BIN_DIST_MAIN_DIR)/mk/post-inplace-script ; then \
287 cp $(BIN_DIST_MAIN_DIR)/mk/post-inplace-script \
288 $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) ; \
289 fi
290 #
291 # binary dist'ing the documentation.
292 # The default documentation to build/install is given below; overrideable
293 # via build.mk or the 'make' command-line.
294
295 ifndef BINDIST_DOC_WAYS
296
297 ifneq "$(XSLTPROC)" ""
298 BINDIST_DOC_WAYS = html
299 ifneq "$(FOP)" ""
300 BINDIST_DOC_WAYS += ps pdf
301 else
302 ifneq "$(PDFXMLTEX)" ""
303 BINDIST_DOC_WAYS += pdf
304 endif
305 ifneq "$(XMLTEX)" ""
306 ifneq "$(DVIPS)" ""
307 BINDIST_DOC_WAYS += ps
308 endif # DVIPS
309 endif # XMLTEX
310 endif # FOP
311 endif # XSLTPROC
312
313 endif # BINDIST_DOC_WAYS
314
315 binary-dist ::
316 ifneq "$(DIR_DOCBOOK_XSL)" ""
317 @for i in $(BIN_DIST_DIRS); do \
318 if test -d "$$i"; then \
319 $(MAKE) -C $$i $(MFLAGS) $(BINDIST_DOC_WAYS); \
320 echo $(MAKE) -C $$i $(MFLAGS) install-docs XMLDocWays="$(BINDIST_DOC_WAYS)" \
321 prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) \
322 exec_prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) \
323 bindir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM) \
324 libdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM) \
325 libexecdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM) \
326 datadir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/share; \
327 $(MAKE) -C $$i $(MFLAGS) install-docs XMLDocWays="$(BINDIST_DOC_WAYS)" \
328 prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) \
329 exec_prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) \
330 bindir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM) \
331 libdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM) \
332 libexecdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM) \
333 datadir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/share; \
334 fi \
335 done
336 endif
337
338 # Rename scripts to $i.prl and $i.sh where necessary.
339 # ToDo: do this in a cleaner way...
340
341 ifneq "$($(Project)BinDistPrlScripts)" ""
342 binary-dist::
343 @for i in $($(Project)BinDistPrlScripts); do \
344 echo "Renaming $$i to $$i.prl"; \
345 $(MV) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM)/$$i $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM)/$$i.prl; \
346 done
347 endif
348
349 ifneq "$($(Project)BinDistLibPrlScripts)" ""
350 binary-dist::
351 @for i in $($(Project)BinDistLibPrlScripts); do \
352 echo "Renaming $$i to $$i.prl"; \
353 $(MV) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/$$i $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/$$i.prl; \
354 done
355 endif
356
357 ifneq "$($(Project)BinDistShScripts)" ""
358 binary-dist::
359 @for i in $($(Project)BinDistShScripts); do \
360 if test -x $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM)/$$i ; then \
361 echo "Renaming $$i to $$i.sh"; \
362 $(MV) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM)/$$i $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM)/$$i.sh; \
363 fi \
364 done
365 endif
366
367 #
368 # Do this separately for now
369 #
370 binary-pack::
371 ( cd $(BIN_DIST_TMPDIR); $(TAR) chzf $(BIN_DIST_NAME).tar.gz $(BIN_DIST_NAME) )
372
373 ifneq "$(way)" ""
374 .PHONY: package-way-dist
375 package-way-dist::
376 ( cd $(BIN_DIST_TMPDIR); $(FIND) $(BIN_DIST_NAME)/ \( -name "*$(_way).a" -o -name "*.$(way_)hi" \) -print | xargs tar cvf $(BIN_DIST_TMPDIR)/ghc-$(ProjectVersion)-$(way)-$(TARGETPLATFORM).tar )
377 gzip $(BIN_DIST_TMPDIR)/ghc-$(ProjectVersion)-$(way)-$(TARGETPLATFORM).tar
378 endif
379
380 ifneq "$(way)" ""
381 remove-way-dist::
382 ( cd $(BIN_DIST_TMPDIR); $(FIND) $(BIN_DIST_NAME)/ \( -name "*$(_way).a" -o -name "*.$(way_)hi" \) -print -exec $(RM) {} \; )
383 endif
384
385 binary-dist::
386 @echo "Mechanical and super-natty! Inspect the result and *if* happy; freeze, sell and get some sleep!"
387
388 # -----------------------------------------------------------------------------
389 # Building source distributions
390 #
391 # Do it like this:
392 #
393 # $ make
394 # $ make dist Project=Ghc
395 #
396 # WARNING: `make dist' calls `make distclean' before tarring up the tree.
397 #
398
399 .PHONY: dist
400
401 #
402 # Directory in which we're going to build the src dist
403 #
404 SRC_DIST_DIR=$(shell pwd)/$(SRC_DIST_NAME)
405
406 #
407 # Files to include in source distributions
408 #
409 SRC_DIST_DIRS += docs distrib $(filter-out docs distrib,$(SUBDIRS))
410 SRC_DIST_FILES += \
411 configure.ac config.guess config.sub configure \
412 aclocal.m4 README Makefile install-sh \
413 mk/bootstrap.mk \
414 mk/boilerplate.mk mk/config.h.in mk/config.mk.in mk/opts.mk \
415 mk/paths.mk mk/package.mk mk/suffix.mk mk/target.mk \
416 mk/fptools.css mk/fix_install_names.sh
417
418 dist dist-manifest dist-package :: project-check
419
420 # clean the tree first, leaving certain extra files in place (eg. configure)
421 dist :: distclean
422
423 dist ::
424 -rm -rf $(SRC_DIST_DIR)
425 -$(RM) $(SRC_DIST_NAME).tar.gz
426 mkdir $(SRC_DIST_DIR)
427 mkdir $(SRC_DIST_DIR)/mk
428 $(FIND) $(SRC_DIST_DIRS) -type d \( -name _darcs -prune -o -name SRC -prune -o -name "autom4te*" -prune -o -print \) | sed -e 's!.*!mkdir "$(SRC_DIST_DIR)/&"!' | sh
429 $(FIND) $(SRC_DIST_DIRS) $(SRC_DIST_FILES) -name _darcs -prune -o -name SRC -prune -o -name "autom4te*" -prune -o -name "*~" -prune -o -name ".cvsignore" -prune -o -name "\#*" -prune -o -name ".\#*" -prune -o -name "log" -prune -o -name "*-SAVE" -prune -o -name "*.orig" -prune -o -name "*.rej" -prune -o ! -type d -print | sed -e 's!.*!$(LN_S) "$(FPTOOLS_TOP_ABS)/&" "$(SRC_DIST_DIR)/&"!' | sh
430
431 # Automatic generation of a MANIFEST file for a source distribution
432 # tree that is ready to go.
433 dist-manifest ::
434 cd $(SRC_DIST_DIR); $(FIND) . \( -type l -o -type f \) -exec ls -lLG {} \; | sed -e 's/\.\///' > MANIFEST
435
436 dist-package :: dist-package-tar-gz
437
438 SRC_DIST_PATHS = $(patsubst %, $(SRC_DIST_NAME)/%, $(SRC_DIST_FILES) $(SRC_DIST_DIRS))
439
440 dist-package-tar-bz2 ::
441 BZIP2=-9 $(TAR) chjf $(SRC_DIST_NAME)-src.tar.bz2 $(SRC_DIST_NAME) || $(RM) $(SRC_DIST_NAME)-src.tar.bz2
442
443 dist-package-tar-gz ::
444 $(TAR) chzf $(SRC_DIST_NAME)-src.tar.gz $(SRC_DIST_NAME) || $(RM) $(SRC_DIST_NAME)-src.tar.gz
445
446 dist-package-zip ::
447 cd ..; $(LN_S) $(FPTOOLS_TOP_ABS) $(SRC_DIST_NAME) && \
448 $(ZIP) $(ZIP_OPTS) -r $(SRC_DIST_NAME)-src.zip $(SRC_DIST_PATHS)
449
450 # -----------------------------------------------------------------------------
451 # HC file bundles
452
453 hc-file-bundle : project-check
454 $(RM) -r $(ProjectNameShort)-$(ProjectVersion)
455 $(LN_S) . $(ProjectNameShort)-$(ProjectVersion)
456 $(FIND) $(ProjectNameShort)-$(ProjectVersion)/ghc/compiler \
457 $(ProjectNameShort)-$(ProjectVersion)/ghc/utils \
458 $(ProjectNameShort)-$(ProjectVersion)/ghc/lib \
459 $(ProjectNameShort)-$(ProjectVersion)/libraries -follow \
460 \( -name "*.hc" -o -name "*_hsc.[ch]" -o -name "*_stub.[ch]" \) -print > hc-files-to-go
461 for f in `$(FIND) $(ProjectNameShort)-$(ProjectVersion)/ghc/compiler $(ProjectNameShort)-$(ProjectVersion)/ghc/utils $(ProjectNameShort)-$(ProjectVersion)/libraries -name "*.hsc" -follow -print` ""; do \
462 if test "x$$f" != "x" && test -e `echo "$$f" | sed 's/hsc$$/hs/g'`; then \
463 echo `echo "$$f" | sed 's/hsc$$/hs/g' ` >> hc-files-to-go ; \
464 fi; \
465 done;
466 for f in `$(FIND) $(ProjectNameShort)-$(ProjectVersion)/ghc/compiler $(ProjectNameShort)-$(ProjectVersion)/ghc/rts -name "*.cmm" -follow -print` ""; do \
467 if test "x$$f" != "x"; then \
468 echo `echo "$$f" | sed 's/cmm$$/hc/g' ` >> hc-files-to-go ; \
469 fi; \
470 done;
471 echo $(ProjectNameShort)-$(ProjectVersion)/libraries/base/GHC/PrimopWrappers.hs >> hc-files-to-go
472 echo $(ProjectNameShort)-$(ProjectVersion)/ghc/compiler/parser/Parser.hs >> hc-files-to-go
473 echo $(ProjectNameShort)-$(ProjectVersion)/ghc/compiler/parser/ParserCore.hs >> hc-files-to-go
474 echo $(ProjectNameShort)-$(ProjectVersion)/ghc/compiler/main/ParsePkgConf.hs >> hc-files-to-go
475 echo $(ProjectNameShort)-$(ProjectVersion)/libraries/haskell-src/Language/Haskell/Parser.hs >> hc-files-to-go
476 tar czf $(ProjectNameShort)-$(ProjectVersion)-$(TARGETPLATFORM)-hc.tar.gz `cat hc-files-to-go`
477
478 CLEAN_FILES += hc-files-to-go *-hc.tar.gz
479
480 # -----------------------------------------------------------------------------
481
482 # Turn off target.mk's rules for 'all', 'boot' and 'install'.
483 NO_BOOT_TARGET=YES
484 NO_ALL_TARGET=YES
485 NO_INSTALL_TARGET=YES
486
487 include $(TOP)/mk/target.mk
488
489 # -----------------------------------------------------------------------------
490