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