corrected obstack check
[libfirm] / testprograms / Makefile.in
1 # Hey Emacs, this is a -*- makefile -*-
2 #
3 # libFIRM Project
4 #
5 # $Id$
6 #
7
8 top_srcdir := @top_srcdir@
9 srcdir = @srcdir@
10 topdir = ..
11 subdir := testprograms
12
13 DIFF ?= diff
14 REF_DIR = $(srcdir)/ref-results
15
16 SOURCES := Makefile.in \
17         array-heap_example.c   empty.c                irr_cf_example.c          \
18         array-stack_example.c  global_var_example.c   irr_loop_example.c        \
19         call_str_example.c     if_else_example.c      memory_example.c          \
20         cond_example.c         if_example.c           oo_program_example.c      \
21         const_eval_example.c   if_while_example.c     three_cfpred_example.c    \
22         dead_block_example.c   inheritance_example.c  while_example.c           \
23         endless_loop.c         global_cse.c           oo_inline_example.c
24
25 bin_EXAMPLES = $(CFILES:.c=)
26 run_bin_EXAMPLES = $(patsubst %.c,./%;,$(CFILES))
27
28
29 include $(topdir)/MakeRules
30
31 CPPFLAGS += -I$(top_srcdir)/ir/adt -I$(top_srcdir)/ir/common -I$(top_srcdir)/ir/debug \
32                 -I$(top_srcdir)/ir/ident -I$(top_srcdir)/ir/ir -I$(top_srcdir)/ir/tr \
33                 -I$(top_srcdir)/ir/tv -I$(top_srcdir)/ir/st  -I$(top_srcdir)/ir/ana
34
35 LDFLAGS += -L$(topdir)
36 LDLIBS += -lfirm -lgmp -liberty
37
38 GENFILES := $(bin_EXAMPLES) *.vcg
39
40 include $(top_srcdir)/MakeTargets
41
42 all:    $(bin_EXAMPLES) $(topdir)/libfirm.a
43
44 run:
45         $(run_bin_EXAMPLES)
46
47 test:   clean all
48         ($(run_bin_EXAMPLES))>run-result.txt
49         -rm $(REF_DIR)/All_types.vcg $(REF_DIR)/*-type.vcg $(REF_DIR)/*-all.vcg  # contains pointers that differ from run to run -- change!!! debug-ints!!
50         ($(DIFF) run-result.txt $(REF_DIR)/run-result.txt) || (echo Libfirm test failed; exit 1)
51         for g in $(REF_DIR)/*.vcg; do\
52                 ($(DIFF) -s `basename $$g` $$g)||   (echo Libfirm test failed; exit 1) \
53         done;
54         @echo Libfirm test successful
55
56 reference: clean all
57         rm -f $(REF_DIR)/*.vcg
58         ($(run_bin_EXAMPLES))>$(REF_DIR)/run-result.txt
59         rm All_types.vcg  *-type.vcg *-all.vcg    # contains pointers that differ from run to run -- change!!! debug-ints!!
60         install -c -m0644 *.vcg $(REF_DIR)
61
62 subdir_clean:
63         rm -f run-result.txt *.vcg $(bin_EXAMPLES)