This change was triggered by BZ #247974 which suggested to include
VEX/test_main.* in the tarball. We don't want to do that because those
files are really just scaffolding for developers to play with and not
meant for general consumption (and are also bitrotting ATM). Therefore,
this patch moves them to the "useful" subdirectory and adds a crude
Makefile there to build the executable.
Makefile-gcc updated accordingly.


git-svn-id: svn://svn.valgrind.org/vex/trunk@2998 8f6e269a-dfd6-0310-a8e1-e2731360e62c
diff --git a/Makefile-gcc b/Makefile-gcc
index 12bf1ed..c29d152 100644
--- a/Makefile-gcc
+++ b/Makefile-gcc
@@ -131,8 +131,7 @@
 
 scratch: clean all
 
-vex: libvex.a test_main.o
-	$(CC) $(CCFLAGS) -o vex test_main.o libvex.a
+vex: libvex.a
 
 libvex.a: $(LIB_OBJS)
 	rm -f libvex.a
@@ -206,15 +205,14 @@
 
 
 clean:
-	rm -f $(LIB_OBJS) *.a vex test_main.o TAG-* \
+	rm -f $(LIB_OBJS) *.a TAG-* \
 		pub/libvex_guest_offsets.h \
 		auxprogs/genoffsets.s
 
 minidist:
 	rm -f vex--minidist-2005MMDD.tar
 	tar cf vex--minidist-2005MMDD.tar $(PUB_HEADERS) $(PRIV_HEADERS) \
-		test_main.c test_main.h				\
-		Makefile					\
+		Makefile-gcc					\
 		`echo $(LIB_OBJS) | sed "s/\.o/\.c/g"`
 	@echo 
 	@echo minidist done, size follows:
@@ -241,10 +239,6 @@
 ALL_HEADERS  = $(PUB_HEADERS) $(PRIV_HEADERS)
 ALL_INCLUDES = $(PUB_INCLUDES) $(PRIV_INCLUDES)
 
-test_main.o: $(PUB_HEADERS) test_main.c test_main.h
-	$(CC) $(CCFLAGS) $(PUB_INCLUDES) -o test_main.o \
-					 -c test_main.c
-
 priv/ir_defs.o: $(ALL_HEADERS) priv/ir_defs.c
 	$(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/ir_defs.o \
 					 -c priv/ir_defs.c
diff --git a/useful/Makefile-vex b/useful/Makefile-vex
new file mode 100644
index 0000000..eb0b461
--- /dev/null
+++ b/useful/Makefile-vex
@@ -0,0 +1,8 @@
+# Crude makefile to build the "vex" executable from test_main.c
+
+vex:
+	(cd ..; make -f Makefile-gcc)
+	cc -I../pub -o vex test_main.c ../libvex.a
+
+clean:
+	rm -f vex
diff --git a/test_main.c b/useful/test_main.c
similarity index 100%
rename from test_main.c
rename to useful/test_main.c
diff --git a/test_main.h b/useful/test_main.h
similarity index 100%
rename from test_main.h
rename to useful/test_main.h
diff --git a/test_main.h.base b/useful/test_main.h.base
similarity index 100%
rename from test_main.h.base
rename to useful/test_main.h.base