in search of an error ...
[libfirm] / Makefile.in
1 #
2 # Project:     libFIRM
3 # File name:   Makefile.in
4 # Purpose:     Top level Makefile
5 # Author:      Till Riedel
6 # Modified by:
7 # Created:
8 # CVS-ID:      $Id$
9 # Copyright:   (c) 2002-2003 Universität Karlsruhe
10 # Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
11 #
12
13
14 # top directory of the source tree
15 top_srcdir := @top_srcdir@
16 # directory with the sources for this directory
17 srcdir := @srcdir@
18 # top directory of the configured tree
19 topdir := .
20 # subdirectory under topdir
21 subdir := .
22 # do we want statistics
23 enable_statistics := @enable_statistics@
24
25 subdirs := ir/adt ir/debug ir/tv ir/common ir/ident ir/ir ir/tr ir/ana ir/st
26
27 ifeq ($(enable_statistics),yes)
28 subdirs += ir/stat
29 endif
30
31 SOURCES := Makefile.in MakeRules.in MakeTargets\
32            aclocal.m4 config.h.in\
33            config.guess config.sub configure.in \
34            stamp-h.in install-sh README configure
35
36 INSTALL_LIBS = libfirm.a
37
38 GENFILES := stamp-h config.log config.cache
39 # config.status config.h.in $(srcdir)/stamp-h.in
40
41 include $(topdir)/MakeRules
42
43 XOFILES += $(addsuffix /subdir.o, $(subdirs))
44
45 include $(top_srcdir)/MakeTargets
46
47 # add target firmjni if configured with --enable-firmjni
48 all: firm
49
50 firm: libfirm.a
51
52 $(OFILES): config.h Makefile
53
54 $(XOFILES): subdir_all
55
56 libfirm.a: $(XOFILES) $(OFILES)
57         $(AR) $(ARFLAGS) $@.new $(XOFILES) $(OFILES)
58         $(RANLIB) $@.new
59         mv -f $@.new $@
60
61 libfirm.so: subdir_all $(XOFILES) $(OFILES)
62         ld -Bshareable -o ./libfirm.so $(XOFILES) -lm
63
64 testprograms:   libfirm.a
65         $(MAKE) -C testprograms
66
67 firmjni:: libfirm.a
68         $(MAKE) -C firmjni
69
70 # gernerate program documentation
71 .PHONY: autodoc
72 autodoc: $(AUTODOCDIR) $(AUTODOCINDEXFILE)
73
74 .PHONY: $(AUTDOCINDEXFILE)
75 $(AUTODOCINDEXFILE): $(CFILES) $(HFILES)
76         $(AUTODOC) $(AUTODOCFILE)
77
78
79 #${srcdir}/configure: configure.in aclocal.m4
80 $(srcdir)/configure: configure.in
81         cd $(srcdir) && autoconf
82
83 # autoheader might not change config.h.in, so touch a stamp file.
84 $(srcdir)/config.h.in: stamp-h.in
85
86 #${srcdir\1c2/stamp-h.in: configure.in aclocal.m4 acconfig.h \
87 $(srcdir)/stamp-h.in: configure.in
88         cd $(srcdir) && autoheader
89         echo timestamp > $(srcdir)/stamp-h.in
90
91 config.h: stamp-h
92 stamp-h: config.h.in config.status
93         ./config.status
94
95 config.status: configure
96         ./config.status --recheck
97
98 # add target test-firmjni if configured with --enable-firmjni
99 test::
100         $(MAKE) -C testprograms test;
101
102 test-firmjni::
103         $(MAKE) -C firmjni test;
104
105 test-reference::
106         $(MAKE) -C testprograms reference;
107
108 test-clean:
109         $(MAKE) -C testprograms realclean
110         $(MAKE) -C firmjni/testprograms clean;