Move current_ir_graph from ir_graph to ir_cons
[libfirm] / Makefile
index 35fc3a6..66f91d1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -19,12 +19,13 @@ builddir     ?= $(top_builddir)/$(variant)
 Q ?= @
 
 CC ?= cc
+DOXYGEN ?= doxygen
 LINK ?= $(CC)
-AR ?= ar ru
+AR ?= ar
 DLLEXT ?= .so
 
 # Variants
-CFLAGS_all        = -fPIC
+CFLAGS_all        = -fPIC -DHAVE_FIRM_REVISION_H
 CFLAGS_debug      = $(CFLAGS_all) -O0 -g3 -DDEBUG_libfirm
 CFLAGS_profile    = $(CFLAGS_all) -O3 -pg -DNDEBUG -fno-inline
 LINKFLAGS_profile = -pg
@@ -164,7 +165,7 @@ libfirm_DEPS    = $(libfirm_OBJECTS:%.o=%.d)
 
 $(libfirm_a): $(libfirm_OBJECTS)
        @echo AR $@
-       $(Q)$(AR) ru $@ $^
+       $(Q)$(AR) -cru $@ $^
 
 $(libfirm_dll): $(libfirm_OBJECTS)
        @echo LINK $@
@@ -176,9 +177,23 @@ $(builddir)/%.o: %.c $(IR_SPEC_GENERATED_FILES) config.h
        @echo CC $@
        $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) $(libfirm_CPPFLAGS) -MMD -c -o $@ $<
 
+firm-doc/libfirm.tag: $(IR_SPEC_GENERATED_FILES) Doxyfile $(wildcard include/libfirm/*.h) $(wildcard include/libfirm/adt/*.h)
+       @echo Doxygen
+       $(Q)$(DOXYGEN)
+
+DOCU_GENERATOR := scripts/gen_docu.py
+firm-doc/html/nodes.html: firm-doc/libfirm.tag $(DOCU_GENERATOR) $(IR_SPEC) scripts/spec_util.py scripts/style.css
+       @echo gen_docu.py
+       $(Q)$(DOCU_GENERATOR) firm-doc/libfirm.tag "" $@
+       $(Q)cp scripts/style.css firm-doc/html
+
+.PHONY: documentation
+documentation: firm-doc/libfirm.tag firm-doc/html/nodes.html
+
 .PHONY: clean
 clean:
        @echo CLEAN
        $(Q)rm -f $(libfirm_OBJECTS)
        $(Q)rm -f $(libfirm_TARGET)
        $(Q)rm -f $(shell find ir/ -name "gen_*.[ch]")
+       $(Q)rm -rf firm-docu