view src/Makefile @ 15:cf0d24827624

Tree traveling and manipulation functions
author Thinker K.F. Li <thinker@codemud.net>
date Fri, 10 Sep 2010 11:43:43 +0800
parents bf14d3ed008e
children
line wrap: on
line source

GCC?=gcc
PLUGIN_SOURCE_FILES= cospy.c
PLUGIN_OBJECT_FILES= $(patsubst %.c,%.o,$(PLUGIN_SOURCE_FILES))
GCCPLUGINS_DIR:= $(shell $(GCC) -print-file-name=plugin)
CFLAGS:= -I$(GCCPLUGINS_DIR)/include -fPIC -O2 -Wall $(CFLAGS)

all: cospy.so

cospy.so: $(PLUGIN_OBJECT_FILES)
	$(GCC) -shared $^ -o $@

test:	cospy.so test.c
	$(GCC) -fplugin=`pwd`/cospy.so $(CFLAGS) -o test-bin test.c

clean:
	for i in *~ *.o *.so test-bin; do \
		if [ -e $$i ]; then \
			echo "delete $$i"; \
			rm -f $$i; \
		fi; \
	done