51fa2b2c84157e2a6215c324c77348bca9a44ccf
[ghc-hetmet.git] / ghc / lib / misc / Makefile
1 # $Id: Makefile,v 1.6 1998/02/25 16:02:20 simonm Exp $
2 #
3 # Makefile for miscellaneous libraries.
4 #
5
6 TOP = ../..
7 include $(TOP)/mk/boilerplate.mk
8
9 WAYS=$(GhcLibWays)
10
11 ifeq "$(way)" ""
12 SUBDIRS = cbits
13 else
14 SUBDIRS=
15 endif
16
17 #-----------------------------------------------------------------------------
18 #       Setting the standard variables
19 #
20
21 LIBRARY = libHSmisc$(_way).a
22 HS_SRCS = $(wildcard *.lhs)
23
24 # Remove Readline.lhs if readline.h isn't available.
25 ifneq "$(GhcLibsWithReadline)" "YES"
26   HS_SRCS := $(filter-out Readline.lhs,$(HS_SRCS))
27 else
28   SRC_HC_OPTS += -I$(ReadlineIncludePath)
29 endif
30
31 HS_OBJS = $(HS_SRCS:.lhs=.$(way_)o)
32 LIBOBJS = $(HS_OBJS)
33 HS_IFACES= $(HS_SRCS:.lhs=.$(way_)hi)
34
35
36 #-----------------------------------------------------------------------------
37 #       Setting the GHC compile options
38
39 SRC_HC_OPTS += -recomp -cpp -fglasgow-exts -fvia-C -Rghc-timing $(GhcLibHcOpts)
40
41 #
42 # Profiling options
43 WAY_p_HC_OPTS += -GPrelude
44 WAY_mr_HC_OPTS += -GPrelude
45
46 #
47 # Object and interface files have suffixes tagged with their ways
48 #
49 ifneq "$(way)" ""
50 SRC_HC_OPTS += -hisuf $(way_)hi
51 endif
52
53 #
54 # Specific flags
55 #
56 BSD_HC_OPTS        += -syslib posix -optc-DNON_POSIX_SOURCE
57 Socket_HC_OPTS     += -I../std/cbits -optc-DNON_POSIX_SOURCE
58 SocketPrim_HC_OPTS += -I../std/cbits -H10m -syslib posix -optc-DNON_POSIX_SOURCE
59
60 #-----------------------------------------------------------------------------
61 #       Dependency generation
62
63 SRC_MKDEPENDHS_OPTS += -syslib posix -I$(GHC_INCLUDE_DIR)
64
65 #-----------------------------------------------------------------------------
66 #       Installation; need to install .hi files as well as libraries
67 #
68 # The interface files are put inside the $(libdir), since they
69 # might (potentially) be platform specific..
70 #
71 # override is used here because for binary distributions, datadir is
72 # set on the command line. sigh.
73 #
74 override datadir:=$(libdir)/imports/misc
75
76 #
77 # Files to install from here
78
79 INSTALL_LIBS  += $(LIBRARY)
80 INSTALL_DATAS += $(HS_IFACES)
81
82 include $(TOP)/mk/target.mk
83