]> pd.if.org Git - uuid/blobdiff - Makefile
Added test framework
[uuid] / Makefile
index 1b1c6bba02af5600f2e215779056ffb76be6294e..35516fe8ba451c5ea79bca2fa86f36086c49d3de 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,33 +3,40 @@
 
 OBJ    = md5.o sha1.o rng.o internal.o
 CC=gcc
+CFLAGS=-Wall -I. -L.
 
 # set the following for windows
 #LDFLAGS += -liphlpapi
 
-all:   uuidgen
+all:   libpduuid.a
 
 windows:       libpduuid.a uuidgen.o
-       gcc $(CFLAGS) -Wall -L. -o $@ uuidgen.o -lpduuid $(LDFLAGS) -liphlpapi
+       $(CC) $(CFLAGS) -Wall -L. -o $@ uuidgen.o -lpduuid $(LDFLAGS) -liphlpapi
 
 libpduuid.a:   $(OBJ)
        ar rcuv $@ $+
        ranlib $@
 
+t/%.t: t/%.o t/ctap.o
+       $(CC) $(CFLAGS) -lpduuid -Wall -I. -o $@ $+ 
+
+test:  t/uuidgen.t libpduuid.a
+       prove t/*.t
+
 md5.o: md5.c
-       gcc $(CFLAGS) -Wall -fPIC -DLTC_SMALL_CODE -c -o $@ $+
+       $(CC) $(CFLAGS) -Wall -fPIC -DLTC_SMALL_CODE -c -o $@ $+
 
 sha1.o:        sha1.c
-       gcc $(CFLAGS) -Wall -fPIC -DLTC_SMALL_CODE -c -o $@ $+
+       $(CC) $(CFLAGS) -Wall -fPIC -DLTC_SMALL_CODE -c -o $@ $+
 
 rng.o: rng.c
-       gcc $(CFLAGS) -Wall -fPIC -c -o $@ $+
+       $(CC) $(CFLAGS) -Wall -fPIC -c -o $@ $+
 
 internal.o:    internal.c
-       gcc $(CFLAGS) -Wall -fPIC -c -o $@ $+
+       $(CC) $(CFLAGS) -Wall -fPIC -c -o $@ $+
 
 uuidgen:       libpduuid.a uuidgen.o
-       gcc $(CFLAGS) -Wall -L. -o $@ uuidgen.o -lpduuid $(LDFLAGS)
+       $(CC) $(CFLAGS) -Wall -L. -o $@ uuidgen.o -lpduuid $(LDFLAGS)
 
 clean:
        rm -f *.o *.a uuidgen postgres/*.o postgres/*.so