aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Taylor <rob.taylor@codethink.co.uk>2007-07-02 13:27:46 +0100
committerJosh Triplett <josh@freedesktop.org>2007-07-13 23:22:46 -0700
commitf744a1419d9264eaa3d8c8b9145488429b19d4a1 (patch)
tree80b812e9e07adbb1b3ad727ce8f10bee68942a46 /Makefile
parentnew get_type_name function (diff)
downloadsparse-f744a1419d9264eaa3d8c8b9145488429b19d4a1.tar.gz
sparse-f744a1419d9264eaa3d8c8b9145488429b19d4a1.tar.bz2
sparse-f744a1419d9264eaa3d8c8b9145488429b19d4a1.zip
add c2xml program
Adds new c2xml program which dumps out the parse tree for a given file as well-formed xml. A DTD for the format is included as parse.dtd. Signed-off-by: Rob Taylor <rob.taylor@codethink.co.uk> [Josh: DTD fixes] Signed-off-by: Josh Triplett <josh@freedesktop.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 15 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 5aa5cd6..cedf092 100644
--- a/Makefile
+++ b/Makefile
@@ -7,6 +7,8 @@ CFLAGS=-O -g -Wall -Wwrite-strings -fpic
LDFLAGS=-g
AR=ar
+HAVE_LIBXML=$(shell pkg-config --exists libxml-2.0 && echo 'yes')
+
#
# For debugging, uncomment the next one
#
@@ -21,8 +23,15 @@ PKGCONFIGDIR=$(LIBDIR)/pkgconfig
PROGRAMS=test-lexing test-parsing obfuscate compile graph sparse test-linearize example \
test-unssa test-dissect ctags
+
+
INST_PROGRAMS=sparse cgcc
+ifeq ($(HAVE_LIBXML),yes)
+PROGRAMS+=c2xml
+INST_PROGRAMS+=c2xml
+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
@@ -107,6 +116,12 @@ test-dissect: test-dissect.o $(LIBS)
ctags: ctags.o $(LIBS)
$(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $< $(LIBS)
+ifeq ($(HAVE_LIBXML),yes)
+c2xml: c2xml.c $(LIBS) $(LIB_H)
+ $(CC) $(LDFLAGS) `pkg-config --cflags --libs libxml-2.0` -o $@ $< $(LIBS)
+
+endif
+
$(LIB_FILE): $(LIB_OBJS)
$(QUIET_AR)$(AR) rcs $@ $(LIB_OBJS)