Fixed configure: should work now in a build directory again
[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 build_subdirs := ir/adt ir/debug ir/tv ir/common ir/ident ir/ir ir/opt ir/tr ir/ana \
26         ir/stat ir/external ir/ana2
27
28 subdirs := $(build_subdirs) ir/config
29
30 SOURCES := Makefile.in MakeRules.in MakeTargets\
31            aclocal.m4 config.h.in\
32            config.guess config.sub configure.in \
33            stamp-h.in install-sh README configure
34
35 SHARED_LIB = libfirm.so
36
37 INSTALL_LIBS = libfirm.a
38
39 GENFILES := stamp-h config.log config.cache
40 # config.status config.h.in $(srcdir)/stamp-h.in
41
42 include $(topdir)/MakeRules
43
44 XOFILES += $(addsuffix /subdir.o, $(build_subdirs))
45
46 include $(top_srcdir)/MakeTargets
47
48 # add target firmjni if configured with --enable-firmjni
49 all: firm
50
51 firm: libfirm.a
52
53 shared: $(SHARED_LIB)
54
55 $(OFILES): config.h Makefile
56
57 $(XOFILES): subdir_all
58
59 libfirm.a: $(XOFILES) $(OFILES)
60         $(AR) $(ARFLAGS) $@.new $(XOFILES) $(OFILES)
61         mv -f $@.new $@
62         $(RANLIB) $@
63
64 libfirm.so: subdir_all $(XOFILES) $(OFILES)
65         ld -Bshareable -o ./libfirm.so $(XOFILES) -lm -L/usr/public/libxml2/lib -lxml2
66
67 testprograms:   libfirm.a
68         $(MAKE) -C testprograms
69
70 firmjni:: libfirm.a
71         $(MAKE) -C firmjni
72
73 # gernerate program documentation
74 .PHONY: autodoc
75 autodoc: $(DOXYFILE)
76         $(DOXYGEN) $(DOXYFILE)
77
78 #${srcdir}/configure: configure.in aclocal.m4
79 $(srcdir)/configure: configure.in
80         cd $(srcdir) && autoconf
81
82 # autoheader might not change config.h.in, so touch a stamp file.
83 $(srcdir)/config.h.in: stamp-h.in
84
85 #${srcdir\1c2/stamp-h.in: configure.in aclocal.m4 acconfig.h \
86 $(srcdir)/stamp-h.in: configure.in
87         cd $(srcdir) && autoheader
88         echo timestamp > $(srcdir)/stamp-h.in
89
90 config.h: stamp-h
91 stamp-h: config.h.in config.status
92         ./config.status
93
94 config.status: configure
95         ./config.status --recheck
96
97 # add target test-firmjni if configured with --enable-firmjni
98 test::
99         $(MAKE) -C testprograms test;
100
101 test-firmjni::
102         $(MAKE) -C firmjni test;
103
104 test-reference::
105         $(MAKE) -C testprograms reference;
106
107 test-clean:
108         $(MAKE) -C testprograms realclean
109         $(MAKE) -C firmjni/testprograms clean;