ff8b041413c48e46ad8d462646bfd9ff3da36251
[hsc2hs.git] / ghc.mk
1
2 # ToDo: maybe use ghc-cabal to configure this stuff and build
3 # Paths_hsc2hs for us.
4 utils/hsc2hs_dist_MODULES = Main Paths_hsc2hs
5 utils/hsc2hs_VERSION = 0.67
6
7 ifeq "$(Windows)" "YES"
8 utils/hsc2hs_dist_PROG = $(GHC_HSC2HS_PGM)
9 $(eval $(call build-prog,utils/hsc2hs,dist,0))
10
11 $(HSC2HS_INPLACE) : inplace/hsc2hs-$(utils/hsc2hs_VERSION)/template-hsc.h
12
13 utils/hsc2hs_template=inplace/hsc2hs-$(utils/hsc2hs_VERSION)/template-hsc.h
14
15 else
16 utils/hsc2hs_dist_PROG = hsc2hs-real
17 $(eval $(call build-prog,utils/hsc2hs,dist,0))
18
19 utils/hsc2hs_template=inplace/lib/hsc2hs-$(utils/hsc2hs_VERSION)/template-hsc.h
20
21 $(HSC2HS_INPLACE) : $(INPLACE_BIN)/hsc2hs-real \
22 $(utils/hsc2hs_template)
23 $(RM) -f $@
24 echo '#!$(SHELL)' >> $@
25 echo 'executablename=$(FPTOOLS_TOP_ABS)/$(INPLACE_BIN)/hsc2hs-real' >>$@
26 echo 'datadir=$(FPTOOLS_TOP_ABS)/inplace/lib/hsc2hs-$(utils/hsc2hs_VERSION)' >>$@
27 cat utils/hsc2hs/hsc2hs.wrapper >>$@
28 $(EXECUTABLE_FILE) $@
29 endif
30
31 $(utils/hsc2hs_template) : utils/hsc2hs/template-hsc.h
32 @$(MKDIRHIER) $(dir $@)
33 $(CP) $< $@
34
35
36 $(utils/hsc2hs_dist_depfile) : utils/hsc2hs/dist/build/Paths_hsc2hs.hs
37
38 utils/hsc2hs/dist/build/Paths_hsc2hs.hs : utils/hsc2hs/ghc.mk $(MKDIRHIER)
39 @$(RM) $@
40 @$(MKDIRHIER) $(dir $@)
41 echo "module Paths_hsc2hs where" >>$@
42 echo "import Data.Version" >>$@
43 echo "getDataFileName s = return s" >>$@
44 echo "version = Version [$(subst .,$(comma),$(utils/hsc2hs_VERSION))] []" >>$@