[project @ 1999-08-06 10:55:26 by simonmar]
[ghc-hetmet.git] / ghc / lib / misc / Makefile
1 # $Id: Makefile,v 1.17 1999/08/06 10:55:26 simonmar 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   ifneq "$(ReadlineIncludePath)" ""
29      SRC_HC_OPTS += -I$(ReadlineIncludePath)
30   endif
31 endif
32
33 HS_OBJS = $(HS_SRCS:.lhs=.$(way_)o)
34 LIBOBJS = $(HS_OBJS)
35 HS_IFACES= $(HS_SRCS:.lhs=.$(way_)hi)
36 SRC_MKDEPENDHS_OPTS += -optdep--include-prelude
37
38 #-----------------------------------------------------------------------------
39 #       Setting the GHC compile options
40
41 SRC_HC_OPTS += -i../concurrent:../posix -recomp -cpp -fglasgow-exts -fvia-C -Rghc-timing $(GhcLibHcOpts)
42
43 #
44 # Profiling options
45 # (what's this stuff doing here?)
46 WAY_p_HC_OPTS += -GPrelude
47 WAY_mr_HC_OPTS += -GPrelude
48
49 #
50 # Object and interface files have suffixes tagged with their ways
51 #
52 ifneq "$(way)" ""
53 SRC_HC_OPTS += -hisuf $(way_)hi
54 endif
55
56 ifneq "$(way)" "dll"
57 SRC_HC_OPTS += -static
58 endif
59
60 #
61 # Specific flags
62 #
63
64 BSD_HC_OPTS          += -I../std/cbits -H8m -optc-DNON_POSIX_SOURCE
65 Socket_HC_OPTS       += -I../std/cbits -optc-DNON_POSIX_SOURCE
66 SocketPrim_HC_OPTS   += -I../std/cbits -H12m -optc-DNON_POSIX_SOURCE
67 PackedString_HC_OPTS += -H12m
68 Native_HC_OPTS       += -H8m
69 Pretty_HC_OPTS       += -H8m
70
71 #-----------------------------------------------------------------------------
72 #       Dependency generation
73
74 SRC_MKDEPENDHS_OPTS += -I$(GHC_INCLUDE_DIR)
75
76 #-----------------------------------------------------------------------------
77 #       Win32 DLL setup
78
79 DLL_NAME = HSmisc.dll
80 DLL_IMPLIB_NAME = libHSmisc_imp.a
81 SRC_BLD_DLL_OPTS += --export-all --output-def=HSmisc.def
82 SRC_BLD_DLL_OPTS += -lwinmm -lwsock32 -lHSrts_imp -lHS_cbits_imp -lHSmisc_cbits_imp -lHS_imp -lHSexts_imp -lgmp -L. -L../../rts/gmp -L../../rts -L../std -L../std/cbits -L../exts -Lcbits
83
84
85 #-----------------------------------------------------------------------------
86 #       Installation; need to install .hi files as well as libraries
87 #
88 # The interface files are put inside the $(libdir), since they
89 # might (potentially) be platform specific..
90 #
91 # override is used here because for binary distributions, datadir is
92 # set on the command line. sigh.
93 #
94 override datadir:=$(libdir)/imports/misc
95
96 #
97 # Files to install from here
98
99 INSTALL_LIBS  += $(LIBRARY)
100 INSTALL_DATAS += $(HS_IFACES)
101
102 include $(TOP)/mk/target.mk
103