aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Li <sparse@chrisli.org>2010-03-30 15:49:16 -0700
committerChristopher Li <sparse@chrisli.org>2010-07-13 19:00:56 +0000
commit7ac4fa3f14eaf1088bf65cab2243d2015f004e52 (patch)
tree9237775528539ae29a5eaf1be2b1bf924fc191cd /Makefile
parentinspect: add some example inspect for symbol and statement (diff)
downloadsparse-7ac4fa3f14eaf1088bf65cab2243d2015f004e52.tar.gz
sparse-7ac4fa3f14eaf1088bf65cab2243d2015f004e52.tar.bz2
sparse-7ac4fa3f14eaf1088bf65cab2243d2015f004e52.zip
inspect: Add test-inspect program
The test program will launch a gtk treeview windows to display the symbol node in the AST. Signed-Off-By: Christopher Li <sparse@chrisli.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 14 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index b07f472..2825e58 100644
--- a/Makefile
+++ b/Makefile
@@ -15,10 +15,11 @@ AR = ar
# CFLAGS += -O0 -DDEBUG -g3 -gdwarf-2
#
-HAVE_LIBXML=$(shell pkg-config --exists libxml-2.0 2>/dev/null && echo 'yes')
-HAVE_GCC_DEP=$(shell touch .gcc-test.c && \
+HAVE_LIBXML:=$(shell pkg-config --exists libxml-2.0 2>/dev/null && echo 'yes')
+HAVE_GCC_DEP:=$(shell touch .gcc-test.c && \
$(CC) -c -Wp,-MD,.gcc-test.d .gcc-test.c 2>/dev/null && \
echo 'yes'; rm -f .gcc-test.d .gcc-test.o .gcc-test.c)
+HAVE_GTK2:=$(shell pkg-config --exists gtk+-2.0 2>/dev/null && echo 'yes')
CFLAGS += -DGCC_BASE=\"$(shell $(CC) --print-file-name=)\"
@@ -46,6 +47,16 @@ INST_PROGRAMS+=c2xml
c2xml_EXTRA_OBJS = `pkg-config --libs libxml-2.0`
endif
+ifeq ($(HAVE_GTK2),yes)
+GTK2_CFLAGS := $(shell pkg-config --cflags gtk+-2.0)
+GTK2_LIBS := $(shell pkg-config --libs gtk+-2.0)
+PROGRAMS += test-inspect
+INST_PROGRAMS += test-inspect
+test-inspect_EXTRA_DEPS := ast-model.o ast-view.o ast-inspect.o
+test-inspect.o $(test-inspect_EXTRA_DEPS): CFLAGS += $(GTK2_CFLAGS)
+test-inspect_EXTRA_OBJS := $(GTK2_LIBS)
+endif
+
LIB_H= token.h parse.h lib.h symbol.h scope.h expression.h target.h \
linearize.h bitmap.h ident-list.h compat.h flow.h allocate.h \
storage.h ptrlist.h dissect.h
@@ -141,7 +152,7 @@ compat-solaris.o: compat/mmap-blob.c $(LIB_H)
compat-mingw.o: $(LIB_H)
compat-cygwin.o: $(LIB_H)
-.c.o:
+%.o: %.c
$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $<
clean: clean-check