Fixed a bug.
[libfirm] / testprograms / Makefile.in
1 #
2 # Project:     libFIRM
3 # File name:   testprograms/Makefile.in
4 # Purpose:
5 # Author:      Boris Boesler, Till Riedel
6 # Modified by:
7 # Created:
8 # CVS-ID:      $Id$
9 # Copyright:   (c) 1999-2003 Universität Karlsruhe
10 # Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
11 #
12
13 top_srcdir := @top_srcdir@
14 srcdir = @srcdir@
15 topdir = ..
16 subdir := testprograms
17
18 DIFF ?= diff -c0
19 REF_DIR = $(srcdir)/ref-results
20
21 SOURCES := Makefile.in                  \
22         array-heap_example.c            \
23         array-stack_example.c           \
24         call_str_example.c              \
25         cond_example.c                  \
26         const_ent_example.c             \
27         const_eval_example.c            \
28         dead_block_example.c            \
29         empty.c                         \
30         endless_loop.c                  \
31         float_example.c                 \
32         global_cse.c                    \
33         global_var_example.c            \
34         identify_types.c                \
35         if_else_example.c               \
36         if_example.c                    \
37         if_while_example.c              \
38         inheritance_example.c           \
39         irr_cf_example.c                \
40         irr_loop_example.c              \
41         memory_example.c                \
42         oo_inline_example.c             \
43         oo_program_example.c            \
44         recursions.c                    \
45         strength_red_example.c          \
46         three_cfpred_example.c          \
47         while_example.c
48
49
50 GENFILES = %.vcg results.txt
51
52 bin_EXAMPLES = $(CFILES:.c=)
53 run_bin_EXAMPLES = $(patsubst %.c,./%;,$(CFILES))
54
55 include $(topdir)/MakeRules
56
57 CPPFLAGS += -I$(top_srcdir)/ir/adt -I$(top_srcdir)/ir/common -I$(top_srcdir)/ir/debug \
58                 -I$(top_srcdir)/ir/ident -I$(top_srcdir)/ir/ir -I$(top_srcdir)/ir/tr \
59                 -I$(top_srcdir)/ir/tv -I$(top_srcdir)/ir/st  -I$(top_srcdir)/ir/ana \
60                 -I$(top_srcdir)/ir/opt -I$(top_srcdir)/ir/stat
61
62 LDFLAGS = -L$(topdir)
63 LDFLAGS+= @LDFLAGS@
64 LDLIBS += -lfirm -liberty @LIBS@
65 # @@@ TODO replace hand crafted stuff (xml2) for configure
66
67 GENFILES := $(bin_EXAMPLES) *.vcg
68
69 include $(top_srcdir)/MakeTargets
70
71 all:    $(bin_EXAMPLES) $(topdir)/libfirm.a
72
73 $(bin_EXAMPLES): $(topdir)/libfirm.a
74
75 run:
76         $(run_bin_EXAMPLES)
77
78 test:   realclean all
79         ls >.ignore
80         rm -rf results; mkdir results; ($(run_bin_EXAMPLES)) >results/run-result.txt; \
81         mv *.vcg results; cd results;
82         @($(DIFF) --brief --exclude=CVS results $(REF_DIR) && \
83         echo Libfirm test successful ) || echo Libfirm test failed ;
84
85 reference: realclean all
86         $(RM) $(REF_DIR)/*.vcg
87         ($(run_bin_EXAMPLES))>$(REF_DIR)/run-result.txt
88         install -c -m0644 *.vcg $(REF_DIR)