[project @ 1999-11-09 10:46:25 by simonmar]
[ghc-hetmet.git] / ghc / lib / std / cbits / Makefile
1 # $Id: Makefile,v 1.8 1999/11/09 10:46:27 simonmar 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 INSTALL_LIBS+=$(LIBRARY)
14
15 C_SRCS= $(wildcard *.c)
16
17 C_OBJS  = $(C_SRCS:.c=.$(way_)o)
18 LIBOBJS = $(C_OBJS)
19 SRC_CC_OPTS += -O -I$(GHC_INCLUDE_DIR) -I$(GHC_RUNTIME_DIR) $(GhcLibCcOpts)
20
21 ifneq "$(way)" "dll"
22 SRC_CC_OPTS += -static
23 endif
24
25 ifeq "$(way)" "dll"
26 all :: DllVersionInfo.o
27
28 $(DLL_NAME) : DllVersionInfo.o
29 endif
30
31 DLL_NAME = HScbits.dll
32 DLL_IMPLIB_NAME = libHScbits_imp.a
33 DLL_DESCRIPTION = "Haskell Prelude helpers"
34 SRC_BLD_DLL_OPTS += --export-all --output-def=HScbits.def DllVersionInfo.o
35 SRC_BLD_DLL_OPTS += -lwinmm -lwsock32 -lHSrts_imp -lgmp -L. -L../../../rts/gmp -L../../../rts
36
37 #
38 # Compile the files using the Haskell compiler (ghc really).
39
40 CC=$(GHC)
41
42 SRC_MKDEPENDC_OPTS += -I$(GHC_INCLUDE_DIR)
43
44 ifeq "$(EnableWin32DLLs)" "YES"
45 INSTALL_PROGS  += $(DLL_NAME)
46 INSTALL_LIBS += $(patsubst %.a, %_imp.a, $(LIBRARY))
47 endif
48
49 include $(TOP)/mk/target.mk