[project @ 1999-10-29 13:55:40 by sof]
[ghc-hetmet.git] / ghc / lib / misc / cbits / Makefile
1 #
2 # Makefile for cbits subdirectory
3 #
4 TOP=../../..
5 include $(TOP)/mk/boilerplate.mk
6
7 ifeq "$(filter dll,$(WAYS))" "dll"
8 override WAYS=dll
9 else
10 override WAYS=
11 endif
12
13 CC:=$(GHC)
14
15 C_SRCS=$(wildcard *.c)
16
17 # Remove Readline.lhs if readline.h isn't available.
18 ifneq "$(HAVE_READLINE)" "YES"
19   C_SRCS := $(filter-out ghcReadline.c,$(C_SRCS))
20 endif
21
22 ifeq "$(EnableWin32DLLs)" "YES"
23   C_SRCS := $(filter-out selectFrom.c,$(C_SRCS))
24 endif
25
26 ifneq "$(way)" "dll"
27 SRC_CC_OPTS += -static
28 endif
29
30 SRC_MKDEPENDC_OPTS += -I$(GHC_INCLUDE_DIR)
31 SRC_CC_OPTS += -I$(GHC_INCLUDE_DIR) -I$(GHC_LIB_DIR)/std/cbits
32
33 LIBRARY=libHSmisc_cbits$(_way).a
34 LIBOBJS=$(C_OBJS)
35 INSTALL_LIBS += $(LIBRARY)
36
37 DLL_NAME = HSmisc_cbits.dll
38 SRC_BLD_DLL_OPTS += --export-all --output-def=HSmisc_cbits.def DllVersionInfo.o
39 SRC_BLD_DLL_OPTS += -lwinmm -lwsock32 -lHSrts_imp -lHScbits_imp -lgmp -L. -L../../../rts/gmp -L../../../rts -L../../std/cbits
40
41 ifeq "$(way)" "dll"
42 all :: DllVersionInfo.o
43 endif
44
45 ifeq "$(EnableWin32DLLs)" "YES"
46 INSTALL_PROGS  += $(DLL_NAME)
47 INSTALL_LIBS += $(patsubst %.a, %_imp.a, $(LIBRARY))
48 endif
49
50 include $(TOP)/mk/target.mk