X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=Makefile;h=3929e5dc3057f23ff76c26ad5099ca097ef4b544;hb=b0b017615d99df915f731aa23842e26a10691f05;hp=66f91d1f189b21283e5b03a5e19c162521ed0488;hpb=ea177aefa204d7120fc927563cbe3dcbb67d3470;p=libfirm diff --git a/Makefile b/Makefile index 66f91d1f1..3929e5dc3 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,7 @@ variant ?= debug srcdir ?= $(top_srcdir) builddir ?= $(top_builddir)/$(variant) +docdir ?= $(top_builddir)/doc # This hides the noisy commandline outputs. You can see them with "make Q=" Q ?= @ @@ -25,16 +26,18 @@ AR ?= ar DLLEXT ?= .so # Variants -CFLAGS_all = -fPIC -DHAVE_FIRM_REVISION_H +CFLAGS_all = -std=c99 -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 -CFLAGS_optimize = $(CFLAGS_all) -O3 -DNDEBUG +CFLAGS_coverage = $(CFLAGS_all) -O0 --coverage -DDEBUG_libfirm +LINKFLAGS_profile = -pg +LINKFLAGS_coverage = --coverage +CFLAGS_optimize = $(CFLAGS_all) -O3 -fomit-frame-pointer -DNDEBUG # General flags CFLAGS += $(CFLAGS_$(variant)) CFLAGS += -Wall -W -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -LINKFLAGS += $(LINKFLAGS_$(variant)) +LINKFLAGS += $(LINKFLAGS_$(variant)) -lm VPATH = $(srcdir) REVISION ?= $(shell git describe --abbrev=40 --always --dirty --match '') @@ -45,8 +48,11 @@ UNUSED := $(shell \ echo "$$REV" | cmp -s - firm_revision.h 2> /dev/null || echo "$$REV" > firm_revision.h \ ) -.PHONY: all all: firm +.PHONY: all + +# disable make builtin suffix rules +.SUFFIXES: # This rule is necessary so that make does not abort if headers get deleted # (the deleted header might still be referenced in a .d file) @@ -59,7 +65,7 @@ $(srcdir)config.h: $(Q)rm -f $@ $(Q)echo "#define libfirm_VERSION_MAJOR 1" >> $@ $(Q)echo "#define libfirm_VERSION_MICRO 0" >> $@ - $(Q)echo "#define libfirm_VERSION_MINOR 20" >> $@ + $(Q)echo "#define libfirm_VERSION_MINOR 21" >> $@ # libFirm libfirm_DIRS := \ @@ -95,7 +101,6 @@ firm: $(libfirm_dll) backends = amd64 arm ia32 sparc TEMPLATE EMITTER_GENERATOR = $(srcdir)ir/be/scripts/generate_emitter.pl -EMITTER_GENERATOR2 = $(srcdir)ir/be/scripts/generate_emitter_new.pl REGALLOC_IF_GENERATOR = $(srcdir)ir/be/scripts/generate_regalloc_if.pl OPCODES_GENERATOR = $(srcdir)ir/be/scripts/generate_new_opcodes.pl @@ -106,7 +111,7 @@ $(1)_GEN_HEADERS = $(1)_SPEC = ir/be/$(1)/$(1)_spec.pl -$$(srcdir)ir/be/$(1)/gen_$(1)_emitter.h $$(srcdir)ir/be/$(1)/gen_$(1)_emitter.c: $$($(1)_SPEC) $$(EMITTER_GENERATOR) $(EMITTER_GENERATOR2) +$$(srcdir)ir/be/$(1)/gen_$(1)_emitter.h $$(srcdir)ir/be/$(1)/gen_$(1)_emitter.c: $$($(1)_SPEC) $$(EMITTER_GENERATOR) @echo GEN $$@ $(Q)$$(EMITTER_GENERATOR) $$($(1)_SPEC) $$(srcdir)ir/be/$(1) $(1)_SOURCES += ir/be/$(1)/gen_$(1)_emitter.c @@ -169,7 +174,7 @@ $(libfirm_a): $(libfirm_OBJECTS) $(libfirm_dll): $(libfirm_OBJECTS) @echo LINK $@ - $(Q)$(LINK) -shared -o $@ $^ + $(Q)$(LINK) -shared $(LINKFLAGS) -o $@ $^ # Generic rules UNUSED := $(shell mkdir -p $(libfirm_DIRS:%=$(builddir)/%)) @@ -177,18 +182,18 @@ $(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 +$(docdir)/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 +$(docdir)/html/nodes.html: $(docdir)/libfirm.tag $(DOCU_GENERATOR) $(IR_SPEC) scripts/spec_util.py scripts/style.css + @echo gen_docu.py $@ + $(Q)$(DOCU_GENERATOR) $(IR_SPEC) $(docdir)/libfirm.tag "" $@ + $(Q)cp scripts/style.css $(docdir)/html -.PHONY: documentation -documentation: firm-doc/libfirm.tag firm-doc/html/nodes.html +.PHONY: doc +doc: $(docdir)/libfirm.tag $(docdir)/html/nodes.html .PHONY: clean clean: @@ -196,4 +201,3 @@ 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