b2bfe1983af396f513e94062b2b0fc12b2fe93e7
[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 = libHS$(_way).a
20 HS_SRCS = $(wildcard *.lhs)
21 HS_OBJS = $(HS_SRCS:.lhs=.$(way_)o)
22 LIBOBJS = $(HS_OBJS)
23 HS_IFACES= $(HS_SRCS:.lhs=.$(way_)hi) GHC.$(way_)hi
24
25
26 #-----------------------------------------------------------------------------
27 #       Setting the GHC compile options
28
29 SRC_HC_OPTS += -recomp -cpp -fglasgow-exts -fvia-C -Rghc-timing $(GhcLibHcOpts)
30
31 #
32 # Profiling options
33 WAY_p_HC_OPTS += -GPrelude
34 WAY_mr_HC_OPTS += -GPrelude
35
36 #
37 # Object and interface files have suffixes tagged with their ways
38 #
39 ifneq "$(way)" ""
40 SRC_HC_OPTS += -hisuf $(way_)hi
41 endif
42
43 #
44 # Specific flags
45 #
46 BSD_HC_OPTS        += -syslib posix -optc-DNON_POSIX_SOURCE
47 Socket_HC_OPTS     += -I../std/cbits -optc-DNON_POSIX_SOURCE
48 SocketPrim_HC_OPTS += -I../std/cbits -H10m -syslib posix -optc-DNON_POSIX_SOURCE
49
50 #-----------------------------------------------------------------------------
51 #       Dependency generation
52
53 SRC_MKDEPENDHS_OPTS += -syslib posix -I$(GHC_INCLUDE_DIR)
54
55 #-----------------------------------------------------------------------------
56 #       Installation; need to install .hi files as well as libraries
57 #
58 # The interface files are put inside the $(libdir), since they
59 # might (potentially) be platform specific..
60 #
61 # override is used here because for binary distributions, datadir is
62 # set on the command line. sigh.
63 #
64 override datadir:=$(libdir)/imports/misc
65
66 #
67 # Files to install from here
68
69 INSTALL_LIBS  += $(LIBRARY)
70 INSTALL_DATAS += $(HS_IFACES)
71
72 include $(TOP)/mk/target.mk
73