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@
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
69 LDLIBS += -lfirm @LIBS@
71 ifeq ($(enable_libcore),yes)
75 ifeq ($(enable_external_effects),yes)
79 ifeq ($(disable_libiberty),yes)
84 GENFILES := $(bin_EXAMPLES) *.vcg
86 include $(top_srcdir)/MakeTargets
88 all: $(bin_EXAMPLES) $(topdir)/libfirm.a
90 $(bin_EXAMPLES): $(topdir)/libfirm.a
97 rm -rf results; mkdir results; ($(run_bin_EXAMPLES)) >results/run-result.txt; \
98 mv *.vcg results; cd results;
99 @($(DIFF) --brief --exclude=CVS results $(REF_DIR) && \
100 echo Libfirm test successful ) || echo Libfirm test failed ;
102 reference: realclean all
103 $(RM) $(REF_DIR)/*.vcg
104 ($(run_bin_EXAMPLES))>$(REF_DIR)/run-result.txt
105 install -c -m0644 *.vcg $(REF_DIR)