Troy D. Hanson 10 年之前
父节点
当前提交
0efeb6d2c6
共有 49 个文件被更改,包括 18 次插入25 次删除
  1. 8 8
      opt/README
  2. 0 11
      opt/bundle/Makefile
  3. 9 5
      opt/libut/Makefile
  4. 0 0
      opt/libut/include/libut.h
  5. 0 0
      opt/libut/include/utarray.h
  6. 0 0
      opt/libut/include/uthash.h
  7. 0 0
      opt/libut/include/utlist.h
  8. 0 0
      opt/libut/include/utmm.h
  9. 0 0
      opt/libut/include/utringbuffer.h
  10. 0 0
      opt/libut/include/utstring.h
  11. 0 0
      opt/libut/include/utvector.h
  12. 0 0
      opt/libut/src/libut.c
  13. 0 0
      opt/libut/src/utmm.c
  14. 0 0
      opt/libut/src/utvector.c
  15. 1 1
      opt/libut/tests/Makefile
  16. 0 0
      opt/libut/tests/README
  17. 0 0
      opt/libut/tests/do_tests
  18. 0 0
      opt/libut/tests/test1.ans
  19. 0 0
      opt/libut/tests/test1.c
  20. 0 0
      opt/libut/tests/test10.ans
  21. 0 0
      opt/libut/tests/test10.c
  22. 0 0
      opt/libut/tests/test11.ans
  23. 0 0
      opt/libut/tests/test11.c
  24. 0 0
      opt/libut/tests/test12.ans
  25. 0 0
      opt/libut/tests/test12.c
  26. 0 0
      opt/libut/tests/test13.ans
  27. 0 0
      opt/libut/tests/test13.c
  28. 0 0
      opt/libut/tests/test14.ans
  29. 0 0
      opt/libut/tests/test14.c
  30. 0 0
      opt/libut/tests/test15.ans
  31. 0 0
      opt/libut/tests/test15.c
  32. 0 0
      opt/libut/tests/test16.ans
  33. 0 0
      opt/libut/tests/test16.c
  34. 0 0
      opt/libut/tests/test2.ans
  35. 0 0
      opt/libut/tests/test2.c
  36. 0 0
      opt/libut/tests/test3.ans
  37. 0 0
      opt/libut/tests/test3.c
  38. 0 0
      opt/libut/tests/test4.ans
  39. 0 0
      opt/libut/tests/test4.c
  40. 0 0
      opt/libut/tests/test5.ans
  41. 0 0
      opt/libut/tests/test5.c
  42. 0 0
      opt/libut/tests/test6.ans
  43. 0 0
      opt/libut/tests/test6.c
  44. 0 0
      opt/libut/tests/test7.ans
  45. 0 0
      opt/libut/tests/test7.c
  46. 0 0
      opt/libut/tests/test8.ans
  47. 0 0
      opt/libut/tests/test8.c
  48. 0 0
      opt/libut/tests/test9.ans
  49. 0 0
      opt/libut/tests/test9.c

+ 8 - 8
opt/README

@@ -1,21 +1,21 @@
-The "bundle" directory is an alternative way to use uthash, utarray, utlist, 
-utstring and utvector in your programs. You can copy the bundle directory
-entirely into your own source tree, then use CFLAGS to add bundle/include
+The "libut" directory is an alternative way to use uthash, utarray, utlist, 
+utstring and utvector in your programs. You can copy the libut directory
+entirely into your own source tree, then use CFLAGS to add libut/include
 to your include-header search path (-I). 
 
 There are two upshots of this. One is that you can just #include "libut.h"
 instead of uthash.h, utarray.h, etc. So it is a convenient wrapper. 
 
-The other benefit of using the bundle is that if you do a "make" in bundle/
-it builds bundle/src/libut.a, which you can then link into your program 
-using LDFLAGS -Lbundle/src -lut. This makes the utvector available. 
+The other benefit of using the libut is that if you do a "make" in libut/
+it builds libut/src/libut.a, which you can then link into your program 
+using LDFLAGS -Llibut/src -lut. This makes the utvector available. 
 
 This also links in the plumbing that supports having a utvector of utstrings.
 
 -------------------------------------------------------------------------------
 
-NOTE: because the bundle/include contains symlinks, to copy this source into
+NOTE: because the libut/include contains symlinks, to copy this source into
       another source tree, make sure you deref symlinks to copy their contents.
       One way to do this, is to use the tar -h option:
 
- tar cjhf - bundle | (cd $DESTDIR; tar xjf -)
+ tar cjhf - libut | (cd $DESTDIR; tar xjf -)

+ 0 - 11
opt/bundle/Makefile

@@ -1,11 +0,0 @@
-SUBDIRS=src tests
-all: $(SUBDIRS)
-
-.PHONY: clean $(SUBDIRS)
-
-$(SUBDIRS):
-	for d in $(SUBDIRS); do $(MAKE) -C $$d; done
-
-clean:
-	rm -f $(OBJS) *.o
-	for d in $(SUBDIRS); do $(MAKE) -C $$d $@; done

+ 9 - 5
opt/bundle/src/Makefile → opt/libut/Makefile

@@ -1,6 +1,6 @@
 OBJS=libut.a
 all: $(OBJS) 
-INCDIR=../include
+INCDIR=./include
 CFLAGS=-I$(INCDIR)
 CFLAGS+=-Wall -Wextra
 CFLAGS+=-g
@@ -8,16 +8,20 @@ CFLAGS+=-g
 libut.a: libut.o utvector.o utmm.o
 	ar r $@ $^
 
-libut.o: libut.c $(INCDIR)/libut.h
+libut.o: src/libut.c $(INCDIR)/libut.h
 	$(CC) $(CFLAGS) -c $<
 
-utvector.o: utvector.c $(INCDIR)/utvector.h
+utvector.o: src/utvector.c $(INCDIR)/utvector.h
 	$(CC) $(CFLAGS) -c $<
 
-utmm.o: utmm.c $(INCDIR)/utmm.h
+utmm.o: src/utmm.c $(INCDIR)/utmm.h
 	$(CC) $(CFLAGS) -c $<
 
-.PHONY: clean 
+.PHONY: clean tests
 
 clean:
 	rm -f $(OBJS) *.o
+	make -C tests clean
+
+tests: libut.a
+	make -C tests 

+ 0 - 0
opt/bundle/include/libut.h → opt/libut/include/libut.h


+ 0 - 0
opt/bundle/include/utarray.h → opt/libut/include/utarray.h


+ 0 - 0
opt/bundle/include/uthash.h → opt/libut/include/uthash.h


+ 0 - 0
opt/bundle/include/utlist.h → opt/libut/include/utlist.h


+ 0 - 0
opt/bundle/include/utmm.h → opt/libut/include/utmm.h


+ 0 - 0
opt/bundle/include/utringbuffer.h → opt/libut/include/utringbuffer.h


+ 0 - 0
opt/bundle/include/utstring.h → opt/libut/include/utstring.h


+ 0 - 0
opt/bundle/include/utvector.h → opt/libut/include/utvector.h


+ 0 - 0
opt/bundle/src/libut.c → opt/libut/src/libut.c


+ 0 - 0
opt/bundle/src/utmm.c → opt/libut/src/utmm.c


+ 0 - 0
opt/bundle/src/utvector.c → opt/libut/src/utvector.c


+ 1 - 1
opt/bundle/tests/Makefile → opt/libut/tests/Makefile

@@ -5,7 +5,7 @@ OBJS=$(patsubst %,%.o,$(PROGS))
 CFLAGS = -I../include
 CFLAGS += -g
 CFLAGS += -Wall -Wextra
-LDFLAGS=-lut -L../src
+LDFLAGS=-L.. -lut 
 
 TEST_TARGET=run_tests
 TESTS=./do_tests

+ 0 - 0
opt/bundle/tests/README → opt/libut/tests/README


+ 0 - 0
opt/bundle/tests/do_tests → opt/libut/tests/do_tests


+ 0 - 0
opt/bundle/tests/test1.ans → opt/libut/tests/test1.ans


+ 0 - 0
opt/bundle/tests/test1.c → opt/libut/tests/test1.c


+ 0 - 0
opt/bundle/tests/test10.ans → opt/libut/tests/test10.ans


+ 0 - 0
opt/bundle/tests/test10.c → opt/libut/tests/test10.c


+ 0 - 0
opt/bundle/tests/test11.ans → opt/libut/tests/test11.ans


+ 0 - 0
opt/bundle/tests/test11.c → opt/libut/tests/test11.c


+ 0 - 0
opt/bundle/tests/test12.ans → opt/libut/tests/test12.ans


+ 0 - 0
opt/bundle/tests/test12.c → opt/libut/tests/test12.c


+ 0 - 0
opt/bundle/tests/test13.ans → opt/libut/tests/test13.ans


+ 0 - 0
opt/bundle/tests/test13.c → opt/libut/tests/test13.c


+ 0 - 0
opt/bundle/tests/test14.ans → opt/libut/tests/test14.ans


+ 0 - 0
opt/bundle/tests/test14.c → opt/libut/tests/test14.c


+ 0 - 0
opt/bundle/tests/test15.ans → opt/libut/tests/test15.ans


+ 0 - 0
opt/bundle/tests/test15.c → opt/libut/tests/test15.c


+ 0 - 0
opt/bundle/tests/test16.ans → opt/libut/tests/test16.ans


+ 0 - 0
opt/bundle/tests/test16.c → opt/libut/tests/test16.c


+ 0 - 0
opt/bundle/tests/test2.ans → opt/libut/tests/test2.ans


+ 0 - 0
opt/bundle/tests/test2.c → opt/libut/tests/test2.c


+ 0 - 0
opt/bundle/tests/test3.ans → opt/libut/tests/test3.ans


+ 0 - 0
opt/bundle/tests/test3.c → opt/libut/tests/test3.c


+ 0 - 0
opt/bundle/tests/test4.ans → opt/libut/tests/test4.ans


+ 0 - 0
opt/bundle/tests/test4.c → opt/libut/tests/test4.c


+ 0 - 0
opt/bundle/tests/test5.ans → opt/libut/tests/test5.ans


+ 0 - 0
opt/bundle/tests/test5.c → opt/libut/tests/test5.c


+ 0 - 0
opt/bundle/tests/test6.ans → opt/libut/tests/test6.ans


+ 0 - 0
opt/bundle/tests/test6.c → opt/libut/tests/test6.c


+ 0 - 0
opt/bundle/tests/test7.ans → opt/libut/tests/test7.ans


+ 0 - 0
opt/bundle/tests/test7.c → opt/libut/tests/test7.c


+ 0 - 0
opt/bundle/tests/test8.ans → opt/libut/tests/test8.ans


+ 0 - 0
opt/bundle/tests/test8.c → opt/libut/tests/test8.c


+ 0 - 0
opt/bundle/tests/test9.ans → opt/libut/tests/test9.ans


+ 0 - 0
opt/bundle/tests/test9.c → opt/libut/tests/test9.c