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