aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/tests/generated/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'cparser/tests/generated/Makefile')
-rw-r--r--cparser/tests/generated/Makefile50
1 files changed, 50 insertions, 0 deletions
diff --git a/cparser/tests/generated/Makefile b/cparser/tests/generated/Makefile
new file mode 100644
index 00000000..fb6e7610
--- /dev/null
+++ b/cparser/tests/generated/Makefile
@@ -0,0 +1,50 @@
+#######################################################################
+# #
+# The Compcert verified compiler #
+# #
+# François Pottier, INRIA Paris-Rocquencourt #
+# #
+# Copyright Institut National de Recherche en Informatique et en #
+# Automatique. All rights reserved. This file is distributed #
+# under the terms of the INRIA Non-Commercial License Agreement. #
+# #
+#######################################################################
+
+.PHONY: all clean
+
+SOURCES := $(wildcard *.c)
+TARGETS := \
+ $(patsubst %.c,%.ccomp.err,$(SOURCES)) \
+ $(patsubst %.c,%.gcc.err,$(SOURCES)) \
+ $(patsubst %.c,%.clang.err,$(SOURCES))
+
+CCOMP := ../../../ccomp
+GCC := gcc
+CLANG := clang
+
+all: $(TARGETS)
+
+clean:
+ @ rm -f *.err *~
+
+%.ccomp.err: %.c $(CCOMP)
+ @ echo $(CCOMP) -c $<
+ @ if $(CCOMP) -c $< 2>$@ ; then \
+ echo "UNEXPECTED SUCCESS: $(CCOMP) -c $< SUCCEEDED!" ; \
+ fi
+ @ if grep "unknown syntax error" $@ ; then \
+ echo "UNKNOWN SYNTAX ERROR!" ; \
+ fi
+
+%.gcc.err: %.c
+ @ echo $(GCC) -c $<
+ @ if $(GCC) -c $< 2>$@ ; then \
+ echo "UNEXPECTED SUCCESS: $(GCC) -c $< SUCCEEDED!" ; \
+ fi
+
+%.clang.err: %.c
+ @ echo $(CLANG) -c $<
+ @ if $(CLANG) -c $< 2>$@ ; then \
+ echo "UNEXPECTED SUCCESS: $(CLANG) -c $< SUCCEEDED!" ; \
+ fi
+