More doxygen docu.
[libfirm] / MakeRules.in
1 # Hey Emacs, this is a -*- makefile -*-
2 #
3 # libFIRM Project
4 #
5 # $Id$
6 #
7
8 VPATH = $(srcdir)
9
10 LIBFIRM_VERSION = @PACKAGE_VERSION@
11
12 CC = @CC@
13 CFLAGS := @CFLAGS@
14 CPPFLAGS := -I. -I$(topdir) -I$(srcdir) -I$(top_srcdir) @CPPFLAGS@
15 prefix?=@prefix@
16 exec_prefix?=@exec_prefix@
17 includedir?=@includedir@
18 libdir?=@libdir@
19 INSTALL = @INSTALL@
20 PACKAGE_NAME = @PACKAGE_NAME@
21 INCLUDEDIR ?= ${includedir}/${PACKAGE_NAME}
22 LIBDIR ?= ${libdir}
23
24 DEFS = @DEFS@
25
26 LD := @LD@
27 LDFLAGS := @LDFLAGS@
28 LD_R := @libfirm_cv_prog_ld_r@
29
30 LN_S := @LN_S@
31
32 # profiling enabled?
33 ifeq (@enable_profile_libfirm@,yes)
34 LDFLAGS += # -g -pg GL: geht bei mir nicht: unrecognised option
35 CFLAGS += -g -pg
36 endif
37
38 AR := @AR@
39 ARFLAGS := rc
40
41 TAR := @TAR@
42 TARDIRNAME := libfirm-$(LIBFIRM_VERSION)
43 TARFILENAME := $(topdir)/$(TARDIRNAME).tar
44 TARFLAGS = -uhf $(TARFILENAME)
45
46 RANLIB := @RANLIB@
47
48 AUTODOC := @DOXYGEN@
49 AUTODOCFILE := libfirm.doxygen
50 AUTODOCDIR := doc/html
51 AUTODOCINDEXFILE := $(AUTODOCDIR)/index.html
52
53 DISTFILES += $(addprefix $(srcdir)/, $(SOURCES))
54 ARCHIVEDISTFILES += $(addprefix $(TARDIRNAME)/$(subdir)/, $(SOURCES))
55 CFILES = $(filter %.c,$(SOURCES) $(GENFILES))
56 HFILES = $(filter %.h,$(SOURCES) $(GENFILES))
57 OFILES = $(CFILES:.c=.o)
58 TAGFILES = $(CFILES) $(HFILES)
59
60 LDLIBS=$(LIBS) -lm -lc
61
62 COMPILE.c = $(CC) -c $(DEFS) $(CPPFLAGS) $(CDEBUG) $(CFLAGS) $(XCFLAGS)
63 COMPILE.s = $(CC) -S $(DEFS) $(CPPFLAGS) $(CDEBUG) $(CFLAGS) $(XCFLAGS)
64
65 %.o: %.c
66         $(COMPILE.c) -o $@ $<
67
68 %.s: %.c
69         $(COMPILE.s) -o $@ $<
70
71 %.i: %.c
72         $(CPP) $(DEFS) $(CPPFLAGS) -o $@ $<
73
74 %.c: %.dot
75         $(DT) $(DTFLAGS) <$^ >$@ || $(fail)
76
77 define fail
78 { $(RM) $@; false; }
79 endef
80
81 # make target given by $@ recursively in $^ ...
82 ifeq (,$(findstring k,$(MAKEFLAGS)))
83 # ... and immediately stop on errors
84 define recurse
85 +@for i in $^ ""; do if test $$i; then $(MAKE) -C $$i $(subst subdir_,,$@) || exit $$?; fi; done
86 endef
87 else
88 # ... and keep going after errors
89 define recurse
90 +@fail=; \
91 for i in $^ ""; do if test $$i; then $(MAKE) -C $$i $(subst subdir_,,$@) || fail=y; fi; done; \
92 test -z "$$fail"
93 endef
94 endif
95
96 targets = all clean depend realclean tags install autodoc dist distrib install_headers install_libs