68d965ed1715514769fefa0fb0316b1accb95ac5
[ghc-hetmet.git] / ghc / lib / std / cbits / Makefile
1 # $Id: Makefile,v 1.13 2000/03/14 01:52:25 sof Exp $
2
3 TOP = ../../..
4 include $(TOP)/mk/boilerplate.mk
5
6 ifeq "$(filter dll,$(WAYS))" "dll"
7 override WAYS=dll
8 else
9 override WAYS=
10 endif
11
12 LIBRARY=libHS_cbits$(_way).a
13
14 C_SRCS= $(wildcard *.c)
15
16 C_OBJS  = $(C_SRCS:.c=.$(way_)o)
17 LIBOBJS = $(C_OBJS)
18 SRC_CC_OPTS += -O -I$(GHC_INCLUDE_DIR) -I$(GHC_RUNTIME_DIR) $(GhcLibCcOpts) -Wall
19
20 ifneq "$(way)" "dll"
21 SRC_CC_OPTS += -static
22 endif
23
24 ifeq "$(way)" "dll"
25 all :: DllVersionInfo.o
26
27 $(DLL_NAME) : DllVersionInfo.o
28 endif
29
30 DLL_NAME = HScbits.dll
31 DLL_IMPLIB_NAME = libHS_cbits_imp.a
32 DLL_DESCRIPTION = "Haskell Prelude helpers"
33 SRC_BLD_DLL_OPTS += --export-all --output-def=HScbits.def DllVersionInfo.o
34 SRC_BLD_DLL_OPTS += -lwinmm -lwsock32 -lHSrts_imp -lgmp -L. -L../../../rts/gmp -L../../../rts
35
36 #
37 # Compile the files using the Haskell compiler (ghc really).
38
39 CC=$(GHC_INPLACE)
40
41 SRC_MKDEPENDC_OPTS += -I$(GHC_INCLUDE_DIR)
42
43 # -----------------------------------------------------------------------------
44 # Installation
45
46 INSTALL_LIBS+=$(LIBRARY)
47
48 ifeq "$(EnableWin32DLLs)" "YES"
49 INSTALL_PROGS  += $(DLL_NAME)
50 INSTALL_LIBS += $(patsubst %.a, %_imp.a, $(LIBRARY))
51 endif
52
53 # install header files for the I/O library.  Other code might want to
54 # plug 
55 override datadir:=$(libdir)/includes
56 INSTALL_DATAS += $(wildcard *.h)
57
58 include $(TOP)/mk/target.mk