X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FMakefile;h=c01d5e2b5e0291174386b4fdfdd5d4181c8c09e3;hb=dff6ab2d210ff6139aaea38bef16c0ae2d1a005a;hp=6cb4e0a32e54d53e479d025ef0ef6ed56b50732b;hpb=50027272414438955dbc41696541cbd25da55883;p=ghc-hetmet.git diff --git a/ghc/rts/Makefile b/ghc/rts/Makefile index 6cb4e0a..c01d5e2 100644 --- a/ghc/rts/Makefile +++ b/ghc/rts/Makefile @@ -1,5 +1,5 @@ #----------------------------------------------------------------------------- -# $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). @@ -42,39 +42,36 @@ LIBOBJS = $(patsubst %.c,%.$(way_)o,$(SRCS_RTS_C)) \ # 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? @@ -85,7 +82,7 @@ ifneq "$(GTK_CONFIG)" "" 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 @@ -107,11 +104,12 @@ SRC_MKDEPENDC_OPTS += -I. -I../includes 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) @@ -123,7 +121,7 @@ unexport CC # # 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 @@ -153,10 +151,18 @@ endif # 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 @@ -164,24 +170,27 @@ ifeq "$(DLLized)" "YES" 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