fix fehler37, ALWAYS RETURN 0 at end of main
[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 # do we want external description of effects
25 enable_external_effects := @enable_external_effects@
26 # do we want to use the libcore for debug and ADT support
27 enable_libcore := @enable_libcore@
28 enable_backend := @enable_backend@
29 backends       := @BACKENDS@
30
31 LIBCORE_CFLAGS = @LIBCORE_CFLAGS@
32 LIBCORE_LIBS   = @LIBCORE_LFLAGS@
33
34 # suck in values for the linking procedure:
35 LDFLAGS                 = @LDFLAGS@ $(LIBCORE_CFLAGS)
36 LIBS                    = @LIBS@ $(LIBCORE_LIBS)
37
38 # plugin subdirectories
39 plugin_subdirs := @plugin_subdirs@
40
41 build_subdirs := ir/adt ir/net ir/debug ir/tv ir/common ir/ident ir/ir \
42                 ir/opt ir/tr ir/ana ir/stat ir/arch ir/lower include/libfirm \
43                 $(plugin_subdirs)
44
45 ifeq ($(enable_external_effects),yes)
46 build_subdirs += ir/external
47 endif
48 ifeq ($(enable_backend),yes)
49 build_subdirs += ir/be $(addprefix ir/be/, $(backends))
50 endif
51
52 build_add_lib := libfirm_xmalloc.a
53
54 subdirs := $(build_subdirs) ir/config
55
56 SOURCES := Makefile.in MakeRules.in MakeTargets\
57            aclocal.m4 config.h.in\
58            config.guess config.sub configure.in \
59            stamp-h.in install-sh README configure
60
61 SHARED_LIB = libfirm.so
62
63 INSTALL_LIBS = libfirm.a $(build_add_lib)
64
65 GENFILES := stamp-h config.log config.cache
66 # config.status config.h.in $(srcdir)/stamp-h.in
67
68 include $(topdir)/MakeRules
69
70 XOFILES += $(addsuffix /subdir.o, $(build_subdirs))
71
72 include $(top_srcdir)/MakeTargets
73
74 # add target firmjni if configured with --enable-firmjni
75 all: firm
76
77 firm: libfirm.a $(build_add_lib)
78
79 shared: $(SHARED_LIB)
80
81 $(OFILES): config.h Makefile
82
83 $(XOFILES): subdir_all
84
85 libfirm.a: $(XOFILES) $(OFILES)
86         $(AR) $(ARFLAGS) $@.new $^
87         mv -f $@.new $@
88         $(RANLIB) $@
89
90 libfirm_xmalloc.a: subdir_all ir/adt/xmalloc.o
91         $(AR) $(ARFLAGS) $@.new ir/adt/xmalloc.o
92         mv -f $@.new $@
93
94 # dont know about xml here
95 libfirm.so: $(XOFILES)
96         ld -Bshareable -o ./libfirm.so $(XOFILES) -lm $(LDFLAGS) $(LIBS)
97
98 testprograms:   libfirm.a
99         $(MAKE) -C testprograms
100
101 firmjni:: libfirm.a
102         $(MAKE) -C firmjni
103
104 # gernerate program documentation
105 .PHONY: autodoc
106 autodoc: $(DOXYFILE)
107         $(DOXYGEN) $(DOXYFILE)
108
109 #${srcdir}/configure: configure.in aclocal.m4
110 $(srcdir)/configure: configure.in
111         cd $(srcdir) && autoconf
112
113 # autoheader might not change config.h.in, so touch a stamp file.
114 $(srcdir)/config.h.in: stamp-h.in
115
116 #${srcdir\1c2/stamp-h.in: configure.in aclocal.m4 acconfig.h \
117 $(srcdir)/stamp-h.in: configure.in
118         cd $(srcdir) && autoheader
119         echo timestamp > $(srcdir)/stamp-h.in
120
121 config.h: stamp-h
122 stamp-h: config.h.in config.status
123         ./config.status
124
125 config.status: configure
126         ./config.status --recheck
127
128 # add target test-firmjni if configured with --enable-firmjni
129 test::
130         $(MAKE) -C testprograms test;
131
132 test-firmjni::
133         $(MAKE) -C firmjni test;
134
135 test-reference::
136         $(MAKE) -C testprograms reference;
137
138 test-clean:
139         $(MAKE) -C testprograms realclean
140         $(MAKE) -C firmjni/testprograms clean;