shithub: libmujs

Download patch

ref: 0d83e44cc1b40213ebb440b04f6cfce720367fa6
parent: 8e938724ff805a6bfe4a8dcc01a6b1c175a6438c
author: Tor Andersson <[email protected]>
date: Tue Feb 11 08:54:28 EST 2014

Add "jsone" makefile target.

Compile all files concatenated as one compilation unit. Speeds up
interpreter significantly, due to cross-unit inlining opportunities.

--- a/Makefile
+++ b/Makefile
@@ -26,6 +26,12 @@
 js: build/main.o build/libjs.a
 	$(CC) -o $@ $^ -lm
 
+libjs.c : $(SRCS)
+	ls $(SRCS) | awk '{print "#include \""$$1"\""}' > $@
+
+jsone: build/main.o build/libjs.o
+	$(CC) -o $@ $^ -lm
+
 tags: $(SRCS) main.c $(HDRS)
 	ctags $^
 
@@ -33,6 +39,6 @@
 	python tests/sputniktests/tools/sputnik.py --tests=tests/sputniktests --command ./js --summary
 
 clean:
-	rm -f astnames.h opnames.h build/* js
+	rm -f astnames.h opnames.h libjs.c build/* js
 
 .PHONY: default test clean