#-----------------------------------------------------------------------------
-# $Id: Makefile,v 1.44 2001/03/23 16:36:21 simonmar Exp $
+# $Id: Makefile,v 1.56 2002/01/15 05:39:15 sof Exp $
#
# This is the Makefile for the runtime-system stuff.
# This stuff is written in C (and cannot be written in Haskell).
# gcc provides lots of useful warnings if you ask it.
# This is a pretty good list to start with - use a # to comment out
# any you don't like.
-WARNING_OPTS += -optc-Wall
-WARNING_OPTS += -optc-W
-WARNING_OPTS += -optc-Wstrict-prototypes
-WARNING_OPTS += -optc-Wmissing-prototypes
-WARNING_OPTS += -optc-Wmissing-declarations
-WARNING_OPTS += -optc-Winline
-WARNING_OPTS += -optc-Waggregate-return
-#WARNING_OPTS += -optc-Wpointer-arith
-WARNING_OPTS += -optc-Wbad-function-cast
-#WARNING_OPTS += -optc-Wcast-align
-#WARNING_OPTS += -optc-Wnested-externs
-#WARNING_OPTS += -optc-Wshadow
-#WARNING_OPTS += -optc-Wcast-qual
-#WARNING_OPTS += -optc-Wno-unused
-#WARNING_OPTS += -optc-Wredundant-decls
-#WARNING_OPTS += -optc-Wconversion
-
-SRC_HC_OPTS += -I../includes -I. -Iparallel $(WARNING_OPTS) $(GhcRtsHcOpts) -optc-DCOMPILING_RTS
+WARNING_OPTS += -Wall
+WARNING_OPTS += -W
+WARNING_OPTS += -Wstrict-prototypes
+WARNING_OPTS += -Wmissing-prototypes
+WARNING_OPTS += -Wmissing-declarations
+WARNING_OPTS += -Winline
+WARNING_OPTS += -Waggregate-return
+#WARNING_OPTS += -Wpointer-arith
+WARNING_OPTS += -Wbad-function-cast
+WARNING_OPTS += -Wcast-align
+#WARNING_OPTS += -Wnested-externs
+#WARNING_OPTS += -Wshadow
+#WARNING_OPTS += -Wcast-qual
+#WARNING_OPTS += -Wno-unused
+#WARNING_OPTS += -Wredundant-decls
+#WARNING_OPTS += -Wconversion
+
+SRC_CC_OPTS += $(GhcRtsCcOpts) $(WARNING_OPTS) -DCOMPILING_RTS
+
+SRC_HC_OPTS += -I../includes -I. -Iparallel $(GhcRtsHcOpts) -DCOMPILING_RTS
ifneq "$(DLLized)" "YES"
SRC_HC_OPTS += -static
endif
-# SRC_HC_OPTS += -optc-fPIC
+# SRC_HC_OPTS += -fPIC
ifeq "$(way)" "mp"
SRC_HC_OPTS += -I$$PVM_ROOT/include
endif
-# compiling straight C files: use all the HC_OPTS, plus any extra options in
-# $(GhcRtsCcOpts).
-SRC_CC_OPTS += $(GhcRtsCcOpts)
-SRC_CC_OPTS += $(HC_OPTS)
-
#-----------------------------------------------------------------------------
# Include the Front panel code?
ifeq "$(GhcRtsWithFrontPanel)" "YES"
SRC_HC_OPTS += `$(GTK_CONFIG) --cflags` -optc-DRTS_GTK_FRONTPANEL
SRCS_RTS_C := $(SRCS_RTS_C) $(wildcard Vis*.c)
-VisCallbacks_CC_OPTS += -optc-Wno-unused
+VisCallbacks_CC_OPTS += -Wno-unused
endif # GhcRtsWithFrontPanel
endif # GTK_CONFIG
ifeq "$(BootingFromHc)" "YES"
# use the normal $(CC) when booting from .hc files
-SRC_CC_OPTS := $(patsubst -optc%,%,$(SRC_CC_OPTS))
-SRC_CC_OPTS += $(PLATFORM_CC_OPTS)
+SRC_CC_OPTS += $(HC_OPTS)
+SRC_CC_OPTS += -I../includes -I. -Iparallel -DCOMPILING_RTS
else
# otherwise, use $(GHC_INPLACE) as the C compiler.
CC=$(GHC_INPLACE)
+CC_OPTS := $(addprefix -optc, $(CC_OPTS)) $(HC_OPTS)
endif
HC=$(GHC_INPLACE)
#
# Building DLLs is only supported on mingw32 at the moment.
#
-HSLIB = rts
+PACKAGE = rts
ifeq "$(DLLized)" "YES"
SRC_BLD_DLL_OPTS += -lHS_imp_stub -lgmp_imp
# and not worth re-implementing in our Makefile framework.
ifneq "$(HaveLibGmp)" "YES"
+ifneq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
+boot ::
+ cd gmp && ./configure --enable-shared=no \
+ --host=`echo $(HOSTPLATFORM) | sed 's/i[567]86/i486/g'`
+else
+# Pass --target to configure of GMP, so that building for mingwin under
+# cygwin works properly (when the host is not the same as the target)
boot ::
- cd gmp && ./configure --enable-shared=no --target=$(HOSTPLATFORM)
+ cd gmp && CC=$(WhatGccIsCalled) ./configure --enable-shared=no --target=$(HOSTPLATFORM)
+endif
-# Slight cheatage here to past host as target, but x-compilation isn't supported by ghc.
+# Slight cheatage here to pass host as target, but x-compilation isn't supported by ghc.
all :: gmp/libgmp.a
all :: $(DLL_PEN)/gmp.dll
$(DLL_PEN)/gmp.dll:
- make -C gmp gmp.dll
+ $(MAKE) -C gmp gmp.dll
$(MV) gmp/gmp.dll $(DLL_PEN)
endif
install :: gmp/libgmp.a
-clean ::
- $(MAKE) -C gmp MAKEFLAGS= clean
-
ifeq "$(way)" ""
+clean distclean maintainer-clean ::
+ -$(MAKE) -C gmp MAKEFLAGS= $@
+
INSTALL_LIBS += gmp/libgmp.a
endif
gmp/libgmp.a ::
$(MAKE) -C gmp MAKEFLAGS=
@$(CP) gmp/.libs/libgmp.a gmp
+ @$(RANLIB) gmp/libgmp.a
endif
+CLEAN_FILES += gmp/libgmp.a
+
#-----------------------------------------------------------------------------
#
# Building the GUM SysMan