summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorDennis, CHENG Renquan <crquan@fedoraproject.org>2010-07-11 23:11:47 +0800
committerDennis, CHENG Renquan <crquan@fedoraproject.org>2010-07-11 23:11:47 +0800
commitfc85c38529fb8c824f616d4ffaf3d1f04badd0a2 (patch)
tree1e294551dfbc126e55f73cedcbc6a814ca9e44df /Makefile
downloadgcc-dot-gen-plugin-fc85c38529fb8c824f616d4ffaf3d1f04badd0a2.tar.gz
gcc-dot-gen-plugin-fc85c38529fb8c824f616d4ffaf3d1f04badd0a2.tar.xz
gcc-dot-gen-plugin-fc85c38529fb8c824f616d4ffaf3d1f04badd0a2.zip
dotgen: Generate Graphiviz format .dot dump of functions control flow graph
+/* Generate Graphiviz format .dot dump of functions control flow graph, + similar as the gcc internal vcg dump. + Copyright (C) 2010 by + Author: "Dennis, CHENG Renquan" <crquan@fedoraproject.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile26
1 files changed, 26 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..453fbeb
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,26 @@
+
+GCC = gcc
+CC = gcc
+
+PLUGIN_FILE = dotgen.so
+PLUGIN_SOURCE_FILES = pass-dgen.c
+PLUGIN_OBJECT_FILES = $(patsubst %.c,%.o,$(PLUGIN_SOURCE_FILES))
+
+GCCPLUGINS_DIR := $(shell $(GCC) -print-file-name=plugin)
+CFLAGS += -I$(GCCPLUGINS_DIR)/include -I$(with_gmp)/include -Wall -O2
+
+all: $(PLUGIN_FILE)
+
+$(PLUGIN_FILE): $(PLUGIN_OBJECT_FILES)
+ $(GCC) -shared -o $@ $^
+
+.PHONY: clean all test
+
+test:
+ @if [ ! -d dump-files ]; then mkdir dump-files; fi
+ $(GCC) -fplugin=./$(PLUGIN_FILE) \
+ -fdump-tree-all -dumpdir dump-files/ \
+ -c test1.c
+
+clean:
+ @-rm -f *~ *.o $(PLUGIN_FILE)