3 # File name: testprograms/Makefile.in
5 # Author: Boris Boesler, Till Riedel
9 # Copyright: (c) 1999-2003 Universität Karlsruhe
10 # Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
13 top_srcdir := @top_srcdir@
16 subdir := testprograms
18 enable_libcore := @enable_libcore@
19 enable_external_effects := @enable_external_effects@
20 disable_libiberty := @disable_libiberty@
22 DIFF ?= diff # -c0 newer diffs do not support/need this
23 REF_DIR = $(srcdir)/ref-results
25 SOURCES := Makefile.in \
26 array-heap_example.c \
27 array-stack_example.c \
31 const_eval_example.c \
32 dead_block_example.c \
37 global_var_example.c \
42 inheritance_example.c \
47 oo_program_example.c \
49 strength_red_example.c \
50 loop_unroll_example.c \
51 three_cfpred_example.c \
55 GENFILES = %.vcg results.txt
57 bin_EXAMPLES = $(CFILES:.c=)
58 run_bin_EXAMPLES = $(patsubst %.c,./%;,$(CFILES))
60 include $(topdir)/MakeRules
62 CPPFLAGS += -I$(top_srcdir)/ir/adt -I$(top_srcdir)/ir/common -I$(top_srcdir)/ir/debug \
63 -I$(top_srcdir)/ir/ident -I$(top_srcdir)/ir/ir -I$(top_srcdir)/ir/tr \
64 -I$(top_srcdir)/ir/tv -I$(top_srcdir)/ir/st -I$(top_srcdir)/ir/ana \
65 -I$(top_srcdir)/ir/opt -I$(top_srcdir)/ir/stat -I$(topdir)/ir/config \
66 -I$(top_srcdir)/ir/arch
70 LDLIBS += -lfirm @LIBS@
72 ifeq ($(enable_libcore),yes)
76 ifeq ($(enable_external_effects),yes)
80 ifeq ($(disable_libiberty),yes)
85 GENFILES := $(bin_EXAMPLES) *.vcg
87 include $(top_srcdir)/MakeTargets
89 all: $(bin_EXAMPLES) $(topdir)/libfirm.a
91 $(bin_EXAMPLES): $(topdir)/libfirm.a
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 ;
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)