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