~ubuntu-branches/debian/sid/c2hs/sid

« back to all changes in this revision

Viewing changes to base/sysdep/Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Arjan Oosting
  • Date: 2006-12-14 00:06:12 UTC
  • mfrom: (3.1.5 feisty)
  • Revision ID: james.westby@ubuntu.com-20061214000612-s7mds83cxqkgv1bj
Tags: 0.14.5-6
* debian/patches/09_replace-deprecated-withObject: Replace all
  occurrences of 'withObject' with 'with' as the deprecated 'withObject'
  was removed with GHC 6.6. (Closes: #402979)
* Set the urgency to medium as the above bug decreases c2hs usefulness
  with GHC 6.6 dramatically. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#  Compiler Toolkit: makefile for the system dependent modules
2
 
#
3
 
#  Author : Manuel M T Chakravarty
4
 
#  Created: 24 October 1997
5
 
#
6
 
#  Version $Revision: 1.18 $ from $Date: 2003/10/19 10:45:27 $
7
 
#
8
 
#  Copyright (c) [1997..2003] Manuel M T Chakravarty
9
 
#
10
 
#  This file is free software; you can redistribute it and/or modify
11
 
#  it under the terms of the GNU General Public License as published by
12
 
#  the Free Software Foundation; either version 2 of the License, or
13
 
#  (at your option) any later version.
14
 
#
15
 
#  This file is distributed in the hope that it will be useful,
16
 
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 
#  GNU General Public License for more details.
19
 
#
20
 
#  = DOCU =====================================================================
21
 
#
22
 
 
23
 
#  ***************************************
24
 
#  !!! This makefile requires GNU make !!!
25
 
#  ***************************************
26
 
 
27
 
# we need the config info to determine which sources we have to compile
28
 
#
29
 
include ../../mk/config.mk
30
 
 
31
 
# info for this part: its package, name, sources and objects files (must be 
32
 
# before the include due to conditionals etc in `common.mk')
33
 
#
34
 
PACKAGE = base
35
 
PCKNAME = ctk
36
 
PART    = sysdep
37
 
SRCS    = SysDep.hs SysDepPosix.hs
38
 
#
39
 
# extra sources for nhc
40
 
#
41
 
ifeq ($(SYS),$(findstring $(SYS),nhc1))
42
 
  SRCS += IOExtsNHC1.hs
43
 
endif
44
 
#
45
 
OBJS    = $(patsubst %.hs,%.o,$(SRCS))
46
 
 
47
 
include ../../mk/common.mk
48
 
 
49
 
# In case we use a GHC4, GHC5, or GHC6 system, we need some extra options for 
50
 
# `SysDep.hs'. 
51
 
#
52
 
# * we currently need `-fvia-C', as the native code generator doesn't grok 
53
 
#   some of the non-standard primitives
54
 
#
55
 
ifeq ($(SYS),$(findstring $(SYS),ghc4 ghc5 ghc6))
56
 
  EXTRAHCFLAGS= -fglasgow-exts -fvia-C
57
 
endif
58
 
 
59
 
# extra dependencies for nhc
60
 
#
61
 
ifeq ($(SYS),$(findstring $(SYS),nhc1))
62
 
SysDep: IOExtsNHC1
63
 
endif
64
 
 
65
 
 
66
 
# make all object files
67
 
#
68
 
objs: $(OBJS)
69
 
 
70
 
# make all
71
 
#
72
 
all: testconfig objs
73
 
 
74
 
 
75
 
# Use appropriate system dependent modules
76
 
# ========================================
77
 
#
78
 
.PHONY: config testconfig
79
 
 
80
 
# name of the Haskell module containing the system dependend code for
81
 
# system $(SYS) -- "SysDep" ++ $(SYS) ++ ".hs"
82
 
#
83
 
# FIXME: Has anybody a good idea how to convert a string to all upper here
84
 
#
85
 
SYSUPPER      = $(subst nhc,NHC,$(subst ghc,GHC,$(SYS)))
86
 
SYSDEPHS      = $(addsuffix .hs,$(addprefix SysDep,$(SYSUPPER)))
87
 
AVAIL_SYSDEPHS= $(wildcard SysDep*.hs)
88
 
 
89
 
# if the code for the requested system is present, enable it; otherwise, error
90
 
#
91
 
# * in case of success, we also invoke a `config' target in the `syntax' part,
92
 
#   as we have to exlude some module for some systems
93
 
#
94
 
# * Then, we check for supports of HSLibs' posix package
95
 
#
96
 
# * SysDepGHC5.hs is an alias of SysDepGHC4.hs
97
 
#
98
 
config:
99
 
        @$(RM) SysDepGHC5.hs SysDepGHC6.hs
100
 
        @$(LN) -s SysDepGHC4.hs SysDepGHC5.hs
101
 
        @$(LN) -s SysDepGHC4.hs SysDepGHC6.hs
102
 
ifeq ($(SYSDEPHS),$(findstring $(SYSDEPHS),$(AVAIL_SYSDEPHS) SysDepGHC5.hs SysDepGHC6.hs))
103
 
        $(RM) SysDep.hs
104
 
        $(LN) -s $(SYSDEPHS) SysDep.hs
105
 
        @echo "*** Configured for compilation system $(SYS)."
106
 
        $(MAKE) -C ../syntax $(MFLAGS) $@
107
 
else
108
 
        @echo "$(SYSDEPHS) in $(AVAIL_SYSDEPHS) SysDepGHC5.hs SysDepGHC6.hs"
109
 
        @echo "*** Unsupported Haskell compiler \`$(SYS)' specified! "
110
 
        @exit 1
111
 
endif
112
 
        $(RM) SysDepPosix.hs
113
 
# Posix (and hence, `runPiped') support disabled, as `runPiped' (1) isn't
114
 
# really used at the moment, (2) should be rewritten anyway, and (3) breaks 
115
 
# with GHC 6.3 as the signature of `forkProcess' changed.
116
 
#ifeq (posix,$(findstring posix,$(SYSFEATURES)))
117
 
#       $(LN) -s SysDepPosixAVAIL.hs SysDepPosix.hs
118
 
#       @echo "*** Configured for use of HSLibs posix package."
119
 
#else
120
 
        $(LN) -s SysDepPosixUNAVAIL.hs SysDepPosix.hs
121
 
#       @echo "*** Configured WITHOUT HSLibs posix package."
122
 
#endif
123
 
 
124
 
# Configured?
125
 
#
126
 
testconfig:
127
 
        @if [ ! -f SysDep.hs ]; then \
128
 
           echo "*** Configure with \`make config' first! "; \
129
 
           exit 1; \
130
 
         fi
131
 
        @echo "*** Compiling with system specifier $(SYS)."
132
 
 
133
 
 
134
 
# misc targets
135
 
# ============
136
 
#
137
 
.PHONY: clean cleanhi
138
 
 
139
 
clean:
140
 
        -$(RM) *.o
141
 
        -$(RM) SysDepGHC5.hs SysDepGHC6.hs SysDep.hs SysDepPosix.hs
142
 
 
143
 
cleanhi:
144
 
        -$(RM) *.hi