7d6162f40c1d2fc431ada15ef8fadc9b8c464eeb
[libfirm] / Makefile.in
1 # Hey Emacs, this is a -*- makefile -*-
2 #
3 # libFIRM Project
4 #
5 # Top level Makefile
6 # $Id$
7 #
8
9
10 # top directory of the source tree
11 top_srcdir := @top_srcdir@
12 # directory with the sources for this directory
13 srcdir := @srcdir@
14 # top directory of the configured tree
15 topdir := .
16 # subdirectory under topdir
17 subdir := .
18
19 subdirs := ir ir/adt ir/debug ir/tv ir/common ir/ident ir/ir ir/tr ir/ana ir/st
20
21 SOURCES := Makefile.in MakeRules.in MakeTargets\
22            aclocal.m4 config.h.in\
23            config.guess config.sub configure.in \
24            stamp-h.in install-sh README configure
25
26 INSTALL_LIBS = libfirm.a
27
28 GENFILES := stamp-h config.log config.cache
29 # config.status config.h.in $(srcdir)/stamp-h.in
30
31 include $(topdir)/MakeRules
32
33 XOFILES += $(addsuffix /subdir.o, $(subdirs))
34
35 include $(top_srcdir)/MakeTargets
36
37
38 all: config.h Makefile libfirm.a
39
40 libfirm.a: subdir_all $(XOFILES) $(OFILES)
41         $(AR) $(ARFLAGS) $@.new $(XOFILES) $(OFILES)
42         $(RANLIB) $@.new
43         mv -f $@.new $@
44
45 testprograms:   libfirm.a
46         $(MAKE) -C testprograms
47 #       $(MAKE) -C firmjni  test  Tut nicht in craks Makefile
48
49
50 # gernerate program documentation
51 .PHONY: autodoc
52 autodoc: $(AUTODOCDIR) $(AUTODOCINDEXFILE)
53
54 .PHONY: $(AUTDOCINDEXFILE)
55 $(AUTODOCINDEXFILE): $(CFILES) $(HFILES)
56         $(AUTODOC) $(AUTODOCFILE)
57
58
59 #${srcdir}/configure: configure.in aclocal.m4
60 $(srcdir)/configure: configure.in
61         cd $(srcdir) && autoconf
62
63 # autoheader might not change config.h.in, so touch a stamp file.
64 $(srcdir)/config.h.in: stamp-h.in
65
66 #${srcdir\1c2/stamp-h.in: configure.in aclocal.m4 acconfig.h \
67 $(srcdir)/stamp-h.in: configure.in
68         cd $(srcdir) && autoheader
69         echo timestamp > $(srcdir)/stamp-h.in
70
71 config.h: stamp-h
72 stamp-h: config.h.in config.status
73         ./config.status
74
75 config.status: configure
76         ./config.status --recheck
77
78 test::
79         $(MAKE) -C testprograms test;
80         $(MAKE) -C firmjni test;
81
82 test-reference::
83         $(MAKE) -C testprograms reference;
84
85 test-clean:
86         $(MAKE) -C testprograms realclean