summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
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)