[project @ 1998-04-30 19:31:03 by sof]
[ghc-hetmet.git] / ghc / includes / Makefile
index d5335fa..058056c 100644 (file)
@@ -8,7 +8,7 @@ include $(TOP)/mk/boilerplate.mk
 #
 # Just to make sure, no ways stuff in here, please.
 #
-WAYS=
+override WAYS=
 
 # De-litted header files
 LH_FILES=$(wildcard *.lh)
@@ -25,6 +25,8 @@ H_CONFIG = config.h
 H_FILES = stgdefs.h rtsdefs.h StgDirections.h StgMachDeps.h error.h \
   ieee-flpt.h gmp.h LLC.h HLC.h
 
+MKDEPENDC_SRCS=mkNativeHdr.c
+
 ALL_FILES = $(DELIT_H_FILES) $(H_FILES)
 ifeq ($(GhcWithNativeCodeGen),YES)
 ALL_FILES += $(TARGETPLATFORM).h
@@ -32,6 +34,16 @@ endif
 
 
 #
+# In main/Signals we need to distinguish between irix5 and irix6,
+# so we suitably mangle HostOS_FULL to get at the major version.
+# (A hack, for sure - ToDo: consider systematically adding more
+# fine-grained OS info to this Makefile/configure soup )
+
+ifeq "$(HostOS_CPP)" "irix"
+IRIX_MAJOR = $(shell echo $(HostOS_Full) | sed 's/\(irix[^.]*\).*$$/\1/' )
+endif
+
+#
 # 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.
@@ -56,6 +68,11 @@ $(H_CONFIG) :
        @echo "#define $(HostOS_CPP)_HOST_OS            1" >> $@
        @echo "#define $(HostOS_CPP)_TARGET_OS          1" >> $@  
        @echo "#define $(HostOS_CPP)_BUILD_OS           1" >> $@
+ifeq "$(HostOS_CPP)" "irix"
+       @echo "#ifndef $(IRIX_MAJOR)_TARGET_OS           " >> $@  
+       @echo "#define $(IRIX_MAJOR)_TARGET_OS          1" >> $@  
+       @echo "#endif                                    " >> $@  
+endif
        @echo >> $@
        @echo "#define $(HostVendor_CPP)_HOST_VENDOR    1" >> $@
        @echo "#define $(HostVendor_CPP)_TARGET_VENDOR  1" >> $@
@@ -72,8 +89,7 @@ $(TARGETPLATFORM).h : mkNativeHdr
 # to do it (ghc really).
 #
 mkNativeHdr : $(HLIT) $(HFILES) mkNativeHdr.c
-       $(HC) -c mkNativeHdr.c
-       $(CC) $(CFLAGS) -o mkNativeHdr mkNativeHdr.c
+       $(CC) -o mkNativeHdr mkNativeHdr.c
 
 all :: $(H_CONFIG) $(ALL_FILES)
 
@@ -90,16 +106,13 @@ boot :: all
 # Install all header files
 #
 # Hackily set the install destination here:
-INSTALL_DATAS += $(DELIT_H_FILES) $(H_FILES) $(TARGETPLATFORM).h
-
 #
-# We want the configuration header files for the different platforms
-# to be put inside the lib/../$(HOSTPLATFORM)/ directory 
+# Note: we keep per-platform copies of all the include files
+# (ditto for interface files). This is not *really* needed, but
+# it gives (perhaps) a cleaner binary dist structure..might change.
 #
-install :: $(H_CONFIG)
-       $(INSTALL_DIR) $(libdir)/includes
-       $(INSTALL_DATA) $(INSTALL_OPTS) $(H_CONFIG) $(libdir)/includes
-
+override datadir:=$(libdir)/includes
+INSTALL_DATAS += $(DELIT_H_FILES) $(H_FILES) $(TARGETPLATFORM).h $(H_CONFIG)
 
 #
 # `make clean' settings: