f40f3eb71d8128b218390236df18bd5e39c7fb50
[oota-llvm.git] / utils / Burg / Makefile
1 ##===- utils/Burg/Makefile ---------------------------------*- Makefile -*-===##
2
3 #                     The LLVM Compiler Infrastructure
4 #
5 # This file was developed by the LLVM research group and is distributed under
6 # the University of Illinois Open Source License. See LICENSE.TXT for details.
7
8 ##===----------------------------------------------------------------------===##
9 LEVEL = ../..
10 TOOLNAME = burg
11 BUILT_SOURCES = gram.tab.c gram.tab.h
12
13 EXTRA_DIST = gram.yc gram.tab.c gram.tab.h sample.gr burg.shar.gz COPYRIGHT Doc
14
15 include $(LEVEL)/Makefile.common
16
17 gram.tab.c gram.tab.h: gram.yc
18         $(Verb) $(BISON) -o gram.tab.c -d $<
19
20 $(ObjDir)/lex.o : gram.tab.h
21
22 clean::
23         $(Verb) $(RM) -rf gram.tab.h gram.tab.c core* *.aux *.log *.dvi sample sample.c tmp
24
25 doc.dvi: doc.tex
26         $(Verb) latex doc; latex doc
27
28 check:: $(ToolBuildPath) $(BUILD_SRC_DIR)/sample.gr
29         $(ToolBuildPath) -I <$(BUILD_SRC_DIR)/sample.gr   >sample.c \
30           && $(CC) $(CFLAGS) -o sample sample.c && ./sample
31         $(ToolBuildPath) -I      $(BUILD_SRC_DIR)/sample.gr   >tmp \
32           && cmp tmp sample.c
33         $(ToolBuildPath) -I     <$(BUILD_SRC_DIR)/sample.gr -o tmp \
34           && cmp tmp sample.c
35         $(ToolBuildPath) -I      $(BUILD_SRC_DIR)/sample.gr -o tmp \
36           && cmp tmp sample.c
37         $(ToolBuildPath) -I -O0 <$(BUILD_SRC_DIR)/sample.gr   >tmp \
38           && cmp tmp sample.c
39         $(ToolBuildPath) -I -=  <$(BUILD_SRC_DIR)/sample.gr   >tmp \
40           && cmp tmp sample.c
41         $(RM) -f tmp sample.c