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
19 REF_DIR = $(srcdir)/ref-results
21 SOURCES := Makefile.in \
22 array-heap_example.c \
23 array-stack_example.c \
27 const_eval_example.c \
28 dead_block_example.c \
33 global_var_example.c \
38 inheritance_example.c \
43 oo_program_example.c \
45 strength_red_example.c \
46 three_cfpred_example.c \
50 GENFILES = %.vcg results.txt
52 bin_EXAMPLES = $(CFILES:.c=)
53 run_bin_EXAMPLES = $(patsubst %.c,./%;,$(CFILES))
55 include $(topdir)/MakeRules
57 CPPFLAGS += -I$(top_srcdir)/ir/adt -I$(top_srcdir)/ir/common -I$(top_srcdir)/ir/debug \
58 -I$(top_srcdir)/ir/ident -I$(top_srcdir)/ir/ir -I$(top_srcdir)/ir/tr \
59 -I$(top_srcdir)/ir/tv -I$(top_srcdir)/ir/st -I$(top_srcdir)/ir/ana \
60 -I$(top_srcdir)/ir/opt -I$(top_srcdir)/ir/stat
64 LDLIBS += -lfirm -liberty @LIBS@
65 # @@@ TODO replace hand crafted stuff (xml2) for configure
67 GENFILES := $(bin_EXAMPLES) *.vcg
69 include $(top_srcdir)/MakeTargets
71 all: $(bin_EXAMPLES) $(topdir)/libfirm.a
73 $(bin_EXAMPLES): $(topdir)/libfirm.a
80 rm -rf results; mkdir results; ($(run_bin_EXAMPLES)) >results/run-result.txt; \
81 mv *.vcg results; cd results;
82 @($(DIFF) --brief --exclude=CVS results $(REF_DIR) && \
83 echo Libfirm test successful ) || echo Libfirm test failed ;
85 reference: realclean all
86 $(RM) $(REF_DIR)/*.vcg
87 ($(run_bin_EXAMPLES))>$(REF_DIR)/run-result.txt
88 install -c -m0644 *.vcg $(REF_DIR)