shithub: libmujs

Download patch

ref: a6ba5356e2858fd6b105dacfc0a784f1969bebdb
parent: 3e050a949ee5249209b38a92b70640a4ad6cde56
author: Tor Andersson <tor@ccxvii.net>
date: Wed Mar 12 12:58:57 EDT 2014

Makefile tweaks.

--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,4 @@
 build
+tags
 tests
 specs
-js
--- a/Makefile
+++ b/Makefile
@@ -5,44 +5,44 @@
 CC := clang
 CFLAGS := -std=c99 -pedantic -Wall -Wextra -Wunreachable-code -Wno-unused-parameter -g
 
-default: build js re
+default: build build/js build/jsone build/re
 
+astnames.h: jsparse.h
+	grep '\(AST\|EXP\|STM\)_' jsparse.h | sed 's/^[ \t]*\(AST_\)\?/"/;s/,.*/",/' | tr A-Z a-z > $@
+
+opnames.h: jscompile.h
+	grep 'OP_' jscompile.h | sed 's/^[ \t]*OP_/"/;s/,.*/",/' | tr A-Z a-z > $@
+
+one.c: $(SRCS)
+	ls $(SRCS) | awk '{print "#include \""$$1"\""}' > $@
+
+jsdump.c: astnames.h opnames.h
+
 build:
 	mkdir -p build
 
-build/%.o : %.c $(HDRS)
+build/%.o: %.c $(HDRS)
 	$(CC) $(CFLAGS) -o $@ -c $<
 
 build/libjs.a: $(OBJS)
 	ar cru $@ $^
 
-astnames.h : jsparse.h
-	grep '\(AST\|EXP\|STM\)_' jsparse.h | sed 's/^[ \t]*\(AST_\)\?/"/;s/,.*/",/' | tr A-Z a-z > $@
-
-opnames.h : jscompile.h
-	grep 'OP_' jscompile.h | sed 's/^[ \t]*OP_/"/;s/,.*/",/' | tr A-Z a-z > $@
-
-jsdump.c : astnames.h opnames.h
-
-one.c : $(SRCS)
-	ls $(SRCS) | awk '{print "#include \""$$1"\""}' > $@
-
-js: build/main.o build/libjs.a
+build/js: build/main.o build/libjs.a
 	$(CC) -o $@ $^ -lm
 
-jsone: build/main.o build/one.o
+build/jsone: build/main.o build/one.o
 	$(CC) -o $@ $^ -lm
 
-re: regex.c utf.c utftype.c
+build/re: regex.c utf.c utftype.c
 	$(CC) $(CFLAGS) -DTEST -o $@ $^
 
 tags: $(SRCS) main.c $(HDRS)
 	ctags $^
 
-test: js
-	python tests/sputniktests/tools/sputnik.py --tests=tests/sputniktests --command ./js --summary
+test: build/js
+	python tests/sputniktests/tools/sputnik.py --tests=tests/sputniktests --command ./build/js --summary
 
 clean:
-	rm -f astnames.h opnames.h one.c build/* js
+	rm -f astnames.h opnames.h one.c build/*
 
 .PHONY: default test clean