1 # -----------------------------------------------------------------------------
2 # $Id: Makefile,v 1.12 2000/08/02 14:13:27 rrt Exp $
6 include $(TOP)/mk/boilerplate.mk
11 H_FILES = $(filter-out gmp.h,$(wildcard *.h)) gmp.h
14 # Header file built from the configure script's findings
18 all :: $(H_CONFIG) NativeDefs.h
20 # gmp.h is copied from the GMP directory
21 gmp.h : $(FPTOOLS_TOP)/ghc/rts/gmp/gmp.h
24 # The fptools configure script creates the configuration header file
25 # and puts it in fptools/mk/config.h. We copy it down to here, prepending
26 # some make variables specifying cpp platform variables.
28 $(H_CONFIG) : $(FPTOOLS_TOP)/mk/config.h
31 @echo "Creating $@..."
33 @echo "#define HostPlatform_TYPE $(HostPlatform_CPP)" > $@
34 @echo "#define TargetPlatform_TYPE $(HostPlatform_CPP)" >> $@
35 @echo "#define BuildPlatform_TYPE $(HostPlatform_CPP)" >> $@
37 @echo "#define $(HostPlatform_CPP)_HOST 1" >> $@
38 @echo "#define $(HostPlatform_CPP)_TARGET 1" >> $@
39 @echo "#define $(HostPlatform_CPP)_BUILD 1" >> $@
41 @echo "#define $(HostArch_CPP)_HOST_ARCH 1" >> $@
42 @echo "#define $(HostArch_CPP)_TARGET_ARCH 1" >> $@
43 @echo "#define $(HostArch_CPP)_BUILD_ARCH 1" >> $@
44 @echo "#define HOST_ARCH \"$(HostArch_CPP)\"" >> $@
46 @echo "#define $(HostOS_CPP)_HOST_OS 1" >> $@
47 @echo "#define $(HostOS_CPP)_TARGET_OS 1" >> $@
48 @echo "#define $(HostOS_CPP)_BUILD_OS 1" >> $@
49 @echo "#define HOST_OS \"$(HostOS_CPP)\"" >> $@
50 ifeq "$(HostOS_CPP)" "irix"
51 @echo "#ifndef $(IRIX_MAJOR)_TARGET_OS " >> $@
52 @echo "#define $(IRIX_MAJOR)_TARGET_OS 1" >> $@
56 @echo "#define $(HostVendor_CPP)_HOST_VENDOR 1" >> $@
57 @echo "#define $(HostVendor_CPP)_TARGET_VENDOR 1" >> $@
58 @echo "#define $(HostVendor_CPP)_BUILD_VENDOR 1" >> $@
59 @cat $(FPTOOLS_TOP)/mk/$@ >> $@
62 # ---------------------------------------------------------------------------
63 # Make NativeDefs.h for the NCG
66 C_SRCS = mkNativeHdr.c
68 NativeDefs.h : mkNativeHdr
69 ./mkNativeHdr >NativeDefs.h
71 CLEAN_FILES += NativeDefs.h
73 # ---------------------------------------------------------------------------
76 # Need config.h to make dependencies in the runtime system source.
81 # Install all header files
83 # Hackily set the install destination here:
85 # Note: we keep per-platform copies of all the include files
86 # (ditto for interface files). This is not *really* needed, but
87 # it gives (perhaps) a cleaner binary dist structure..might change.
89 override datadir:=$(libdir)/includes
90 INSTALL_DATAS += $(H_FILES) $(H_CONFIG)
93 # `make clean' settings:
95 CLEAN_FILES += $(H_CONFIG)
98 # Finally, slurp in the standard targets.
100 include $(TOP)/mk/target.mk