$(FLEX) -t $(FLEX_OPTS) $< > $@
#-----------------------------------------------------------------------------
-# Yacc stuff
-
-%.tab.c %.tab.h : %.y
- @$(RM) $*.tab.h $*.tab.c y.tab.c y.tab.h y.output
- $(YACC) $(YACC_OPTS) $<
- $(MV) y.tab.c $*.tab.c
- @chmod 444 $*.tab.c
- $(MV) y.tab.h $*.tab.h
- @chmod 444 $*.tab.h
-
-
-#-----------------------------------------------------------------------------
# Runtest rules for calling $(HC) on a single-file Haskell program
%.runtest : %.hs
#-----------------------------------------------------------------------------
# Preprocessor suffix rule
+# We're careful to remove cpp-droppings from the generated file; things like
+# '#line' pragmas. But we also leave in #include directives, because these
+# are likely to be intentional (perhaps the file is going to be CPP'd again -
+# this is used by ghc/compiler/parser/Parser.y.pp).
+
% : %.pp
@$(RM) $@
- $(CPP) $(RAWCPP_FLAGS) $(CPP_OPTS) -x c $< | $(SED) -e '/^#/d' > $@
+ $(CPP) $(RAWCPP_FLAGS) $(CPP_OPTS) -x c $< | $(SED) -e '/^#[^i]/d' > $@