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