4 # File name: testprograms/Makefile.in
6 # Author: Boris Boesler, Till Riedel
10 # Copyright: (c) 1999-2003 Universität Karlsruhe
11 # Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
14 top_srcdir := @top_srcdir@
17 subdir := testprograms
20 REF_DIR = $(srcdir)/ref-results
22 SOURCES := Makefile.in \
23 array-heap_example.c empty.c irr_cf_example.c \
24 array-stack_example.c global_var_example.c irr_loop_example.c \
25 call_str_example.c if_else_example.c memory_example.c \
26 cond_example.c if_example.c oo_program_example.c \
27 const_eval_example.c if_while_example.c three_cfpred_example.c \
28 dead_block_example.c inheritance_example.c while_example.c \
29 endless_loop.c global_cse.c oo_inline_example.c
31 GENFILES = %.vcg results.txt
33 bin_EXAMPLES = $(CFILES:.c=)
34 run_bin_EXAMPLES = $(patsubst %.c,./%;,$(CFILES))
36 include $(topdir)/MakeRules
38 CPPFLAGS += -I$(top_srcdir)/ir/adt -I$(top_srcdir)/ir/common -I$(top_srcdir)/ir/debug \
39 -I$(top_srcdir)/ir/ident -I$(top_srcdir)/ir/ir -I$(top_srcdir)/ir/tr \
40 -I$(top_srcdir)/ir/tv -I$(top_srcdir)/ir/st -I$(top_srcdir)/ir/ana
44 LDLIBS += -lfirm -liberty
46 GENFILES := $(bin_EXAMPLES) *.vcg
48 include $(top_srcdir)/MakeTargets
50 all: $(bin_EXAMPLES) $(topdir)/libfirm.a
52 $(bin_EXAMPLES): $(topdir)/libfirm.a
59 rm -rf results; mkdir results; ($(run_bin_EXAMPLES)) >results/run-result.txt; \
60 mv *.vcg results; cd results;
61 @($(DIFF) --exclude=CVS results $(REF_DIR) && \
62 echo Libfirm test successful ) || echo Libfirm test failed ;
64 reference: realclean all
65 $(RM) $(REF_DIR)/*.vcg
66 ($(run_bin_EXAMPLES))>$(REF_DIR)/run-result.txt
67 install -c -m0644 *.vcg $(REF_DIR)