X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fincludes%2FMakefile;h=e0f4b90e529847f4b3bddd75c1b41d50bb731701;hb=4be58768d4974fd1bddae44f12a0fde1f7fe6b30;hp=bf4e43e24301a271b190052fa161597c4053475c;hpb=438596897ebbe25a07e1c82085cfbc5bdb00f09e;p=ghc-hetmet.git diff --git a/ghc/includes/Makefile b/ghc/includes/Makefile index bf4e43e..e0f4b90 100644 --- a/ghc/includes/Makefile +++ b/ghc/includes/Makefile @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# $Id: Makefile,v 1.11 1998/12/02 13:21:15 simonm Exp $ +# $Id: Makefile,v 1.21 2003/03/21 15:45:56 sof Exp $ # TOP = .. @@ -8,25 +8,41 @@ include $(TOP)/mk/boilerplate.mk # # All header files # -H_FILES = $(wildcard *.h) +H_FILES = $(filter-out gmp.h,$(wildcard *.h)) gmp.h + +# +# Options -- if we're building unregisterised, add a couple of -D's +# +ifeq "$(GhcUnregisterised)" "YES" +SRC_CC_OPTS += -DNO_REGS -DUSE_MINIINTERPRETER +endif # # Header file built from the configure script's findings # H_CONFIG = config.h +boot :: gmp.h + all :: $(H_CONFIG) NativeDefs.h +# gmp.h is copied from the GMP directory +gmp.h : $(FPTOOLS_TOP)/ghc/rts/gmp/gmp.h + $(CP) $< $@ + # The fptools configure script creates the configuration header file # and puts it in fptools/mk/config.h. We copy it down to here, prepending # some make variables specifying cpp platform variables. # -$(H_CONFIG) : $(FPTOOLS_TOP)/mk/config.h +$(H_CONFIG) : $(FPTOOLS_TOP)/mk/config.h $(FPTOOLS_TOP)/mk/config.mk $(H_CONFIG) : @echo "Creating $@..." @$(RM) $@ - @echo "#define HostPlatform_TYPE $(HostPlatform_CPP)" > $@ + @echo "#ifndef __FPTOOLS_CONFIG_H__" >$@ + @echo "#define __FPTOOLS_CONFIG_H__" >>$@ + @echo >> $@ + @echo "#define HostPlatform_TYPE $(HostPlatform_CPP)" >> $@ @echo "#define TargetPlatform_TYPE $(HostPlatform_CPP)" >> $@ @echo "#define BuildPlatform_TYPE $(HostPlatform_CPP)" >> $@ @echo >> $@ @@ -53,18 +69,38 @@ endif @echo "#define $(HostVendor_CPP)_TARGET_VENDOR 1" >> $@ @echo "#define $(HostVendor_CPP)_BUILD_VENDOR 1" >> $@ @cat $(FPTOOLS_TOP)/mk/$@ >> $@ + @echo "#endif /* __FPTOOLS_CONFIG_H__ */" >> $@ @echo "Done." # --------------------------------------------------------------------------- +# Make DerivedConstants.h for the compiler + +all :: DerivedConstants.h + +mkDerivedConstants.c : $(H_CONFIG) + +mkDerivedConstantsHdr : mkDerivedConstants.o + $(CC) -o $@ $(CC_OPTS) $(LD_OPTS) mkDerivedConstants.o + +DerivedConstants.h : mkDerivedConstantsHdr + ./mkDerivedConstantsHdr >DerivedConstants.h + +CLEAN_FILES += mkDerivedConstantsHdr$(exeext) DerivedConstants.h + +# --------------------------------------------------------------------------- # Make NativeDefs.h for the NCG -C_PROG = mkNativeHdr -C_SRCS = mkNativeHdr.c +all :: NativeDefs.h + +mkNativeHdr.o : DerivedConstants.h + +mkNativeHdr : mkNativeHdr.o + $(CC) -o $@ $(CC_OPTS) $(LD_OPTS) mkNativeHdr.o NativeDefs.h : mkNativeHdr ./mkNativeHdr >NativeDefs.h -CLEAN_FILES += NativeDefs.h +CLEAN_FILES += mkNativeHdr$(exeext) NativeDefs.h # --------------------------------------------------------------------------- # boot setup: @@ -82,7 +118,7 @@ boot :: all # (ditto for interface files). This is not *really* needed, but # it gives (perhaps) a cleaner binary dist structure..might change. # -override datadir:=$(libdir)/includes +override datadir:=$(libdir)/include INSTALL_DATAS += $(H_FILES) $(H_CONFIG) #