a6ec133aaa782fb3787c9d976c090ecee9377176
[libfirm] / 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 enable_libcore          := @enable_libcore@
19 enable_external_effects := @enable_external_effects@
20 disable_libiberty       := @disable_libiberty@
21
22 DIFF ?= diff -c0
23 REF_DIR = $(srcdir)/ref-results
24
25 SOURCES := Makefile.in                  \
26         tarval_test.c                   \
27         array-heap_example.c            \
28         array-stack_example.c           \
29         call_str_example.c              \
30         cond_example.c                  \
31         const_ent_example.c             \
32         const_eval_example.c            \
33         dead_block_example.c            \
34         empty.c                         \
35         endless_loop.c                  \
36         float_example.c                 \
37         global_cse.c                    \
38         global_var_example.c            \
39         identify_types.c                \
40         if_else_example.c               \
41         if_example.c                    \
42         if_while_example.c              \
43         inheritance_example.c           \
44         irr_cf_example.c                \
45         irr_loop_example.c              \
46         memory_example.c                \
47         oo_inline_example.c             \
48         oo_program_example.c            \
49         recursions.c                    \
50         strength_red_example.c          \
51         loop_unroll_example.c           \
52         three_cfpred_example.c          \
53         while_example.c
54
55
56 GENFILES = %.vcg results.txt
57
58 bin_EXAMPLES = $(CFILES:.c=)
59 run_bin_EXAMPLES = $(patsubst %.c,./%;,$(CFILES))
60
61 include $(topdir)/MakeRules
62
63 CPPFLAGS += -I$(top_srcdir)/ir/adt -I$(top_srcdir)/ir/common -I$(top_srcdir)/ir/debug \
64                 -I$(top_srcdir)/ir/ident -I$(top_srcdir)/ir/ir -I$(top_srcdir)/ir/tr \
65                 -I$(top_srcdir)/ir/tv -I$(top_srcdir)/ir/st  -I$(top_srcdir)/ir/ana \
66                 -I$(top_srcdir)/ir/opt -I$(top_srcdir)/ir/stat
67
68 LDFLAGS = -L$(topdir)
69 LDFLAGS+= @LDFLAGS@
70 LDLIBS += -lfirm @LIBS@
71
72 ifeq ($(enable_libcore),yes)
73 LDLIBS += -lcore
74 endif
75
76 ifeq ($(enable_external_effects),yes)
77 LDLIBS += -lxml
78 endif
79
80 ifeq ($(disable_libiberty),yes)
81 LDLIBS += -liberty
82 endif
83
84
85 GENFILES := $(bin_EXAMPLES) *.vcg
86
87 include $(top_srcdir)/MakeTargets
88
89 all:    $(bin_EXAMPLES) $(topdir)/libfirm.a
90
91 $(bin_EXAMPLES): $(topdir)/libfirm.a
92
93 run:
94         $(run_bin_EXAMPLES)
95
96 test:   realclean all
97         ls >.ignore
98         rm -rf results; mkdir results; ($(run_bin_EXAMPLES)) >results/run-result.txt; \
99         mv *.vcg results; cd results;
100         @($(DIFF) --brief --exclude=CVS results $(REF_DIR) && \
101         echo Libfirm test successful ) || echo Libfirm test failed ;
102
103 reference: realclean all
104         $(RM) $(REF_DIR)/*.vcg
105         ($(run_bin_EXAMPLES))>$(REF_DIR)/run-result.txt
106         install -c -m0644 *.vcg $(REF_DIR)