1 # Hey Emacs, this is a -*- makefile -*-
10 # top directory of the source tree
11 top_srcdir := @top_srcdir@
12 # directory with the sources for this directory
14 # top directory of the configured tree
16 # subdirectory under topdir
20 exec_prefix := @exec_prefix@
21 bindir = $(exec_prefix)/bin
22 datadir = $(prefix)/lib
24 subdirs := ir ir/adt ir/debug ir/tv ir/common ir/ident ir/ir ir/tr
26 SOURCES := Makefile.in MakeRules.in MakeTargets\
27 aclocal.m4 config.h.in\
28 config.guess config.sub configure.in \
29 stamp-h.in install-sh README
31 INSTALL_LIBS = libfirm.a
33 GENFILES := stamp-h config.log config.cache
36 ARCHIVEDISTFILES := testprograms/Makefile.in \
37 testprograms/array-heap_example.c testprograms/if_example.c \
38 testprograms/array-stack_example.c testprograms/if_while_example.c \
39 testprograms/call_str_example.c testprograms/inheritance_example.c \
40 testprograms/cond_example.c testprograms/irr_cf_example.c \
41 testprograms/const_eval_example.c testprograms/irr_loop_example.c \
42 testprograms/dead_block_example.c testprograms/memory_example.c \
43 testprograms/empty.c testprograms/oo_program_example.c \
44 testprograms/global_var_example.c testprograms/three_cfpred_example.c \
45 testprograms/if_else_example.c testprograms/while_example.c \
47 DISTFILES = $(addprefix ../, $(ARCHIVEDISTFILES))
49 # config.status config.h.in $(srcdir)/stamp-h.in
51 include $(topdir)/MakeRules
53 DISTFILES += $(addprefix $(srcdir)/, configure)
54 ARCHIVEDISTFILES += $(addprefix $(subdir)/, configure)
56 XOFILES += $(addsuffix /subdir.o, $(subdirs))
58 include $(top_srcdir)/MakeTargets
61 all: config.h Makefile libfirm.a
63 libfirm.a: subdir_all $(XOFILES) $(OFILES)
64 $(AR) $(ARFLAGS) $@.new $(XOFILES) $(OFILES)
68 testprograms: libfirm.a
69 $(MAKE) -C testprograms
72 # generate program documentation
74 autodoc: autodoc_xref $(AUTODOCDIR) $(GLOBALXREFFILE) autodoc_html $(INDEXFILE)
76 $(GLOBALXREFFILE): $(addsuffix /$(LOCALXREFSFILE), $(subdirs)) .xrefs
79 find $(PWD) -name "*.xref" -print > $@
81 $(INDEXFILE): $(GLOBALXREFFILE)
82 $(AUTODOC) $(GLOBALXREFFILE) $@ INDEX HTML
85 #${srcdir}/configure: configure.in aclocal.m4
86 $(srcdir)/configure: configure.in
87 cd $(srcdir) && autoconf
89 # autoheader might not change config.h.in, so touch a stamp file.
90 $(srcdir)/config.h.in: stamp-h.in
92 #${srcdir
\1c2/stamp-h.in: configure.in aclocal.m4 acconfig.h \
93 $(srcdir)/stamp-h.in: configure.in
94 cd $(srcdir) && autoheader
95 echo timestamp > $(srcdir)/stamp-h.in
98 stamp-h: config.h.in config.status
101 config.status: configure
102 ./config.status --recheck