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