Makefile 1.08 KB
Newer Older
1
2
3
4
5
#
# Makefile for cbits subdirectory
#
TOP=../../..
include $(TOP)/mk/boilerplate.mk
sof's avatar
sof committed
6
7
8
9

ifeq "$(filter dll,$(WAYS))" "dll"
override WAYS=dll
else
10
override WAYS=
sof's avatar
sof committed
11
endif
12

13
CC:=$(GHC)
14
15
16
17

C_SRCS=$(wildcard *.c)

# Remove Readline.lhs if readline.h isn't available.
18
ifneq "$(HAVE_READLINE)" "YES"
19
20
21
  C_SRCS := $(filter-out ghcReadline.c,$(C_SRCS))
endif

sof's avatar
sof committed
22
23
24
25
26
27
28
29
ifeq "$(EnableWin32DLLs)" "YES"
  C_SRCS := $(filter-out selectFrom.c,$(C_SRCS))
endif

ifneq "$(way)" "dll"
SRC_CC_OPTS += -static
endif

sof's avatar
sof committed
30
SRC_MKDEPENDC_OPTS += -I$(GHC_INCLUDE_DIR)
31
SRC_CC_OPTS += -I$(GHC_INCLUDE_DIR) -I$(GHC_LIB_DIR)/std/cbits
32

sof's avatar
sof committed
33
LIBRARY=libHSmisc_cbits$(_way).a
34
35
36
LIBOBJS=$(C_OBJS)
INSTALL_LIBS += $(LIBRARY)

sof's avatar
sof committed
37
DLL_NAME = HSmisc_cbits.dll
sof's avatar
sof committed
38
SRC_BLD_DLL_OPTS += --export-all --output-def=HSmisc_cbits.def DllVersionInfo.o
sof's avatar
sof committed
39
40
SRC_BLD_DLL_OPTS += -lwinmm -lwsock32 -lHSrts_imp -lHScbits_imp -lgmp -L. -L../../../rts/gmp -L../../../rts -L../../std/cbits

sof's avatar
sof committed
41
42
43
44
ifeq "$(way)" "dll"
all :: DllVersionInfo.o
endif

sof's avatar
sof committed
45
46
47
48
ifeq "$(EnableWin32DLLs)" "YES"
INSTALL_PROGS  += $(DLL_NAME)
INSTALL_LIBS += $(patsubst %.a, %_imp.a, $(LIBRARY))
endif
sof's avatar
sof committed
49

50
include $(TOP)/mk/target.mk