about summary refs log tree commit diff
path: root/test/Makefile
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2017-12-02 03:00:57 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2017-12-02 03:00:57 +0000
commit8cd418cff0eae8d2190a165202f1efb9f0cb9046 (patch)
treec1703b93d27a322d725930270512bd32bdad74e3 /test/Makefile
parent33df17eedb1d9220f280115a3300ac655ac03a38 (diff)
downloadnetpbm-mirror-8cd418cff0eae8d2190a165202f1efb9f0cb9046.tar.gz
netpbm-mirror-8cd418cff0eae8d2190a165202f1efb9f0cb9046.tar.xz
netpbm-mirror-8cd418cff0eae8d2190a165202f1efb9f0cb9046.zip
Make tests work on Mac OS
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3096 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/Makefile')
-rw-r--r--test/Makefile10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/Makefile b/test/Makefile
index 9b7ab047..4f0c063f 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -10,7 +10,9 @@ MERGE_OBJECTS =
 
 PROGS = testrandom
 
-all: $(PROGS)
+OKSTOGENERATE = $(patsubst %.rand-ok, %.ok, $(wildcard *.rand-ok))
+
+all: $(PROGS) $(OKSTOGENERATE)
 
 testrandom.o: testrandom.c
 	$(CC_FOR_BUILD) -c -o $@ $(CFLAGS_FOR_BUILD) $<
@@ -18,6 +20,10 @@ testrandom.o: testrandom.c
 testrandom: testrandom.o
 	$(LD_FOR_BUILD) -o $@ $(LDFLAGS_FOR_BUILD) $<
 
+RAND_VARIETY ?= $(shell ./testrandom -x)
+
+$(OKSTOGENERATE): %.ok: %.rand-ok testrandom
+	sed -n "/^$(RAND_VARIETY)|/s/^$(RAND_VARIETY)|//p" $< > $@
 
 OMIT_TEST_RULE = 1
 include $(SRCDIR)/common.mk
@@ -25,4 +31,4 @@ include $(SRCDIR)/common.mk
 distclean clean: cleanlocal
 .PHONY: cleanlocal
 cleanlocal:
-	rm -f $(PROGS)
+	rm -f $(PROGS) $(OKSTOGENERATE)