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 loop_unroll_example.c \
47 three_cfpred_example.c \
51 GENFILES = %.vcg results.txt
53 bin_EXAMPLES = $(CFILES:.c=)
54 run_bin_EXAMPLES = $(patsubst %.c,./%;,$(CFILES))
56 include $(topdir)/MakeRules
58 CPPFLAGS += -I$(top_srcdir)/ir/adt -I$(top_srcdir)/ir/common -I$(top_srcdir)/ir/debug \
59 -I$(top_srcdir)/ir/ident -I$(top_srcdir)/ir/ir -I$(top_srcdir)/ir/tr \
60 -I$(top_srcdir)/ir/tv -I$(top_srcdir)/ir/st -I$(top_srcdir)/ir/ana \
61 -I$(top_srcdir)/ir/opt -I$(top_srcdir)/ir/stat
65 LDLIBS += -lfirm -liberty @LIBS@
66 # @@@ TODO replace hand crafted stuff (xml2) for configure
68 GENFILES := $(bin_EXAMPLES) *.vcg
70 include $(top_srcdir)/MakeTargets
72 all: $(bin_EXAMPLES) $(topdir)/libfirm.a
74 $(bin_EXAMPLES): $(topdir)/libfirm.a
81 rm -rf results; mkdir results; ($(run_bin_EXAMPLES)) >results/run-result.txt; \
82 mv *.vcg results; cd results;
83 @($(DIFF) --brief --exclude=CVS results $(REF_DIR) && \
84 echo Libfirm test successful ) || echo Libfirm test failed ;
86 reference: realclean all
87 $(RM) $(REF_DIR)/*.vcg
88 ($(run_bin_EXAMPLES))>$(REF_DIR)/run-result.txt
89 install -c -m0644 *.vcg $(REF_DIR)