0c67a62fe7925acbca46df7adc99bfd50baba74c
[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 prefix := @prefix@
20 exec_prefix := @exec_prefix@
21 bindir = $(exec_prefix)/bin
22 datadir = $(prefix)/lib
23
24 subdirs := ir/adt ir/debug ir/tv ir/common ir/ident ir/ir ir/tr
25
26 SOURCES := Makefile.in MakeRules.in MakeTargets\
27            aclocal.m4 config.h.in\
28            config.guess config.sub configure.in \
29            stamp-h.in
30
31 INSTALL_LIBS = libfirm.a
32
33 GENFILES := stamp-h config.log config.cache
34
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
44 all: config.h Makefile libfirm.a
45
46 libfirm.a: subdir_all $(XOFILES) $(OFILES)
47         $(AR) $(ARFLAGS) $@.new $(XOFILES) $(OFILES)
48         $(RANLIB) $@.new
49         mv -f $@.new $@
50
51 testprograms:   libfirm.a
52         $(MAKE) -C testprograms
53
54
55 # generate program documentation
56 .PHONY: autodoc
57 autodoc: autodoc_xref $(AUTODOCDIR) $(GLOBALXREFFILE) autodoc_html $(INDEXFILE)
58
59 $(GLOBALXREFFILE): $(addsuffix /$(LOCALXREFSFILE), $(subdirs)) .xrefs
60 #       cat $^ > $@
61         $(RM) $@
62         find $(PWD) -name "*.xref" -print > $@
63
64 $(INDEXFILE): $(GLOBALXREFFILE)
65         $(AUTODOC) $(GLOBALXREFFILE) $@ INDEX HTML
66
67
68 #${srcdir}/configure: configure.in aclocal.m4
69 $(srcdir)/configure: configure.in
70         cd $(srcdir) && autoconf
71
72 # autoheader might not change config.h.in, so touch a stamp file.
73 $(srcdir)/config.h.in: stamp-h.in
74
75 #${srcdir\1c2/stamp-h.in: configure.in aclocal.m4 acconfig.h \
76 $(srcdir)/stamp-h.in: configure.in
77         cd $(srcdir) && autoheader
78         echo timestamp > $(srcdir)/stamp-h.in
79
80 config.h: stamp-h
81 stamp-h: config.h.in config.status
82         ./config.status
83
84 config.status: configure
85         ./config.status --recheck