bugfix
[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/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 libfirm.so
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 # add target firmjni if configured with --enable-firmjni
38 all: firm
39
40 firm: config.h Makefile libfirm.a libfirm.so
41
42 libfirm.a: subdir_all $(XOFILES) $(OFILES)
43         $(AR) $(ARFLAGS) $@.new $(XOFILES) $(OFILES)
44         $(RANLIB) $@.new
45         mv -f $@.new $@
46
47 libfirm.so: subdir_all $(XOFILES) $(OFILES)
48         ld -Bshareable -o ./libfirm.so $(XOFILES) -lm
49
50 testprograms:   libfirm.a
51         $(MAKE) -C testprograms
52
53 firmjni:: libfirm.a
54         $(MAKE) -C firmjni
55
56 # gernerate program documentation
57 .PHONY: autodoc
58 autodoc: $(AUTODOCDIR) $(AUTODOCINDEXFILE)
59
60 .PHONY: $(AUTDOCINDEXFILE)
61 $(AUTODOCINDEXFILE): $(CFILES) $(HFILES)
62         $(AUTODOC) $(AUTODOCFILE)
63
64
65 #${srcdir}/configure: configure.in aclocal.m4
66 $(srcdir)/configure: configure.in
67         cd $(srcdir) && autoconf
68
69 # autoheader might not change config.h.in, so touch a stamp file.
70 $(srcdir)/config.h.in: stamp-h.in
71
72 #${srcdir\1c2/stamp-h.in: configure.in aclocal.m4 acconfig.h \
73 $(srcdir)/stamp-h.in: configure.in
74         cd $(srcdir) && autoheader
75         echo timestamp > $(srcdir)/stamp-h.in
76
77 config.h: stamp-h
78 stamp-h: config.h.in config.status
79         ./config.status
80
81 config.status: configure
82         ./config.status --recheck
83
84 # add target test-firmjni if configured with --enable-firmjni
85 test::
86         $(MAKE) -C testprograms test;
87
88 test-firmjni::
89         $(MAKE) -C firmjni test;
90
91 test-reference::
92         $(MAKE) -C testprograms reference;
93
94 test-clean:
95         $(MAKE) -C testprograms realclean
96         $(MAKE) -C firmjni/testprograms clean;