Index: Makefile =================================================================== RCS file: /home/cvs/root/hat/src/hatlib/Makefile,v retrieving revision 1.49 diff -u -r1.49 Makefile --- Makefile 16 Feb 2004 12:04:22 -0000 1.49 +++ Makefile 22 Jun 2004 10:52:58 -0000 @@ -51,7 +51,7 @@ TRANSSRCS = \ PreludeBuiltin.hs PreludeBasic.hs IOBuiltinTypes.hs \ SystemBuiltinTypes.hs TimeBuiltinTypes.hs DirectoryBuiltinTypes.hs \ - Prelude.hs Char.hs Ratio.hs List.hs Complex.hs Numeric.hs \ + Char.hs Ratio.hs List.hs Complex.hs Numeric.hs \ Maybe.hs Monad.hs Ix.hs Array.hs IO.hs System.hs \ Locale.hs CPUTime.hs Time.hs Random.hs Directory.hs \ Data/IORef.hs Data/Bool.hs Data/Char.hs Data/Complex.hs Data/Ix.hs \ @@ -82,6 +82,12 @@ TRANSHATS = $(patsubst %, Hat/%, $(TRANSSRCS)) TRANSOBJS = $(patsubst %.hs, $(OBJDIR)/Hat/%.o, $(TRANSSRCS)) +# these Haskell sources are just like TRANSSRCS except we need to +# fiddle with the .hx file afterwards +FIDDLESRCS = Prelude.hs +FIDDLEHATS = $(patsubst %, Hat/%, $(FIDDLESRCS)) +FIDDLEOBJS = $(patsubst %.hs, $(OBJDIR)/Hat/%.o, $(FIDDLESRCS)) + all: install install: $(OBJDIR) $(OBJDIRS) $(TARGDIR) $(TARGDIRS) $(TARGET) @@ -98,7 +104,7 @@ do $(INSTALL) $(OBJDIR)/$$dir/*.hi $(TARGDIR)/$$dir; \ done clean: - -rm -rf $(OBJDIR) $(TRANSHATS) Hat/*.hi Hat/Hat.hx \ + -rm -rf $(OBJDIR) $(TRANSHATS) $(FIDDLEHATS) Hat/*.hi Hat/Hat.hx \ $(patsubst %.hs, %.hx, $(TRANSSRCS)) $(OBJDIR) $(OBJDIRS) $(TARGDIR) $(TARGDIRS): mkdir -p $@ || $(TRUE) @@ -112,13 +118,18 @@ $(HC) $(HFLAGS) -c -o $@ Hat/$< mv $(patsubst %.hs, Hat/%.hi, $<) $(patsubst %.hs, ${OBJDIR}/Hat/%.hi, $<) +$(FIDDLEOBJS): $(OBJDIR)/Hat/%.o: %.hs + $(LOCAL)hat-trans -cpp -P. -I. -trusted -prelude $(CPPFLAGS) $< + $(HC) $(HFLAGS) -c -o $@ Hat/$< + mv $(patsubst %.hs, Hat/%.hi, $<) $(patsubst %.hs, ${OBJDIR}/Hat/%.hi, $<) + $(LOCAL)hat-trans -cpp -DHX -P. -I. -trusted -prelude $(CPPFLAGS) $< $(COBJS): $(OBJDIR)/%.o: %.c $(CC) $(CFLAGS) -c -o $@ $< # single archive for all object files -$(TARGET): $(COBJS) $(PLAINOBJS) $(TRANSOBJS) - $(AR) cr $(TARGET) $(COBJS) $(PLAINOBJS) $(TRANSOBJS) +$(TARGET): $(COBJS) $(PLAINOBJS) $(FIDDLEOBJS) $(TRANSOBJS) + $(AR) cr $(TARGET) $(COBJS) $(PLAINOBJS) $(FIDDLEOBJS) $(TRANSOBJS) ranlib $(TARGET) Index: Prelude.hs =================================================================== RCS file: /home/cvs/root/hat/src/hatlib/Prelude.hs,v retrieving revision 1.3 diff -u -r1.3 Prelude.hs --- Prelude.hs 23 Jan 2002 18:22:57 -0000 1.3 +++ Prelude.hs 22 Jun 2004 10:52:58 -0000 @@ -1,3 +1,4 @@ +{-# hat-trans -cpp #-} -- Wrapper that exports just the stuff normally defined in the -- Prelude. -- Has to be transformed into TPreludeTracing.hs and renamed to TPrelude.hs. @@ -39,7 +40,8 @@ -- These built-in types are defined in the Prelude, but -- are denoted by built-in syntax, and cannot legally -- appear in an export list. --- But they do here, because the transformed module will need the exports +-- But they do here, because the .hx interface needs the exports. +#ifdef HX -- List type: []((:), []), -- Tuple types: up to 15 @@ -52,6 +54,7 @@ ()(()), -- Functions: (->), +#endif Eq((==), (/=)), Ord(compare, (<), (<=), (>=), (>), max, min),