diff --git a/.gitignore b/.gitignore
index 91d763fc3c4821560fbd51ade846e723b07a8855..02c15e67c929b9f07875f212fe58a8efb3cd77bd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,2 @@
 *~
-sp.q
-sp.json
+*.json
diff --git a/Makefile b/Makefile
index 0f5f9c854955a3c469ba69025509abd05ece1b01..1ba6c7a4582b2f68f5129fb13208386414b8b6cf 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,15 @@
 QFILES != find . -name '[ws]s[[:digit:]][[:digit:]].q' -type f
+JFILES := $(QFILES:%.q=%.json)
 
 .PHONY: all
 all: sp.json
 
-sp.json: $(QFILES)
-	./gen.pl $^ > $@
+$(JFILES): %.json: %.q
+	./gen.pl $< > $@
+
+sp.json: $(JFILES)
+	jq -cs '[.[][]]' $^ > $@
 
 .PHONY: clean
 clean:
-	rm -f sp.json
+	rm -f sp.json $(JFILES)