Skip to content

Commit

Permalink
Merge pull request svaarala#1808 from ffontaine/master
Browse files Browse the repository at this point in the history
 Replace gcc by $(CC) in extras Makefiles
  • Loading branch information
svaarala authored Nov 14, 2017
2 parents 8cb0b83 + c214a07 commit 711da95
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 10 deletions.
5 changes: 3 additions & 2 deletions extras/alloc-pool/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# For manual testing; say 'make' in extras/alloc-pool and run ./test.

CC=gcc
DEFS=
#DEFS+='-DDUK_ALLOC_POOL_DEBUG'

Expand All @@ -12,7 +13,7 @@ test:
--output-directory ./prep \
--option-file ./opts.yaml \
--fixup-line 'extern void my_fatal(const char *msg);'
gcc -std=c99 -Wall -Wextra -m32 -Os -otest \
$(CC) -std=c99 -Wall -Wextra -m32 -Os -otest \
-I./prep ./prep/duktape.c \
$(DEFS) \
duk_alloc_pool.c test.c \
Expand All @@ -32,7 +33,7 @@ ptrcomptest:
--option-file ../../config/examples/low_memory.yaml \
--option-file ptrcomp.yaml \
--fixup-file ptrcomp_fixup.h
gcc -std=c99 -Wall -Wextra -m32 -Os -optrcomptest \
$(CC) -std=c99 -Wall -Wextra -m32 -Os -optrcomptest \
-I. -I./prep ./prep/duktape.c \
$(DEFS) \
duk_alloc_pool.c test.c \
Expand Down
3 changes: 2 additions & 1 deletion extras/cbor/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# For manual testing; say 'make' in extras/cbor.

VALGRIND=valgrind
CC=gcc
CCOPTS=-std=c99 -Wall -Wextra -O2
#CCOPTS+=-fsanitize=undefined

Expand All @@ -21,7 +22,7 @@ jsoncbor: jsoncbor.c duk_cbor.c duk_cbor.h
-DDUK_USE_JSON_EATWHITE_FASTPATH \
-DDUK_USE_JSON_QUOTESTRING_FASTPATH \
-DDUK_USE_JSON_STRINGIFY_FASTPATH
gcc $(CCOPTS) -o $@ -I./prep -I. ./prep/duktape.c duk_cbor.c jsoncbor.c -lm
$(CC) $(CCOPTS) -o $@ -I./prep -I. ./prep/duktape.c duk_cbor.c jsoncbor.c -lm

appendix_a.json:
wget -O $@ https://raw.githubusercontent.com/cbor/test-vectors/master/appendix_a.json
Expand Down
4 changes: 3 additions & 1 deletion extras/console/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# For manual testing; say 'make' in extras/console and run ./test.

CC = gcc

.PHONY: test
test:
-rm -rf ./prep
python2 ../../tools/configure.py --quiet --output-directory ./prep
gcc -std=c99 -Wall -Wextra -o $@ -I./prep -I. ./prep/duktape.c duk_console.c test.c -lm
$(CC) -std=c99 -Wall -Wextra -o $@ -I./prep -I. ./prep/duktape.c duk_console.c test.c -lm
./test 'console.assert(true, "not shown");'
./test 'console.assert(false, "shown", { foo: 123 });'
./test 'console.log(1, 2, 3, { foo: "bar" });'
Expand Down
4 changes: 3 additions & 1 deletion extras/duk-v1-compat/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# For manual testing; say 'make' in extras/duk-v1-compat and run ./test.

CC = gcc

.PHONY: test
test:
-rm -rf ./prep
python2 ../../tools/configure.py --quiet --output-directory ./prep
gcc -std=c99 -Wall -Wextra -o $@ -I./prep -I. ./prep/duktape.c duk_v1_compat.c test.c -lm
$(CC) -std=c99 -Wall -Wextra -o $@ -I./prep -I. ./prep/duktape.c duk_v1_compat.c test.c -lm
./test

.PHONY: clean
Expand Down
5 changes: 4 additions & 1 deletion extras/logging/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# For manual testing; say 'make' in extras/logging and run ./test.

CC = gcc

.PHONY: test
test:
-rm -rf ./prep
python2 ../../tools/configure.py --quiet --output-directory ./prep
gcc -std=c99 -Wall -Wextra -otest -I./prep ./prep/duktape.c duk_logging.c test.c -lm
$(CC) -std=c99 -Wall -Wextra -otest -I./prep ./prep/duktape.c duk_logging.c test.c -lm
./test 'L = new Duktape.Logger(); L.trace("testing"); L.l = 0; L.trace("testing 2");'
./test 'L = new Duktape.Logger(); L.debug("testing"); L.l = 1; L.debug("testing 2");'
./test 'L = new Duktape.Logger(); L.info("testing");'
Expand Down
4 changes: 3 additions & 1 deletion extras/minimal-printf/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Just for manual testing
CC = gcc

.PHONY: test
test: duk_minimal_printf.c
gcc -std=c99 -Wall -Wextra -fno-stack-protector -m32 -Os -fomit-frame-pointer -otest duk_minimal_printf.c test.c
$(CC) -std=c99 -Wall -Wextra -fno-stack-protector -m32 -Os -fomit-frame-pointer -otest duk_minimal_printf.c test.c
./test
4 changes: 3 additions & 1 deletion extras/module-duktape/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# For manual testing; say 'make' in extras/module-duktape and run ./test.
# There's test coverage in tests/ecmascript, so tests here are very simple.

CC = gcc

.PHONY: test
test:
-rm -rf ./prep
python2 ../../tools/configure.py --quiet --output-directory ./prep
gcc -std=c99 -Wall -Wextra -o $@ -I./prep -I. ./prep/duktape.c duk_module_duktape.c test.c -lm
$(CC) -std=c99 -Wall -Wextra -o $@ -I./prep -I. ./prep/duktape.c duk_module_duktape.c test.c -lm
@printf '\n'
./test 'assert(typeof require === "function");'
./test 'assert(require.name === "require");'
Expand Down
4 changes: 3 additions & 1 deletion extras/module-node/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# For manual testing; say 'make' in extras/module-node and run ./test.

CC = gcc

.PHONY: test
test:
-rm -rf ./prep
python2 ../../tools/configure.py --quiet --output-directory ./prep
gcc -std=c99 -Wall -Wextra -o $@ -I./prep -I. ./prep/duktape.c duk_module_node.c test.c -lm
$(CC) -std=c99 -Wall -Wextra -o $@ -I./prep -I. ./prep/duktape.c duk_module_node.c test.c -lm
@printf '\n'
./test 'assert(typeof require("pig") === "string", "basic require()");'
./test 'assert(require("cow").indexOf("pig") !== -1, "nested require()");'
Expand Down
5 changes: 4 additions & 1 deletion extras/print-alert/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# For manual testing; say 'make' in extras/print-alert and run ./test.

CC = gcc

.PHONY: test
test:
-rm -rf ./prep
python2 ../../tools/configure.py --quiet --output-directory ./prep
gcc -std=c99 -Wall -Wextra -otest -I./prep ./prep/duktape.c duk_print_alert.c test.c -lm
$(CC) -std=c99 -Wall -Wextra -otest -I./prep ./prep/duktape.c duk_print_alert.c test.c -lm
./test 'print("foo", "bar", 1, 2, 3)'
./test 'alert("foo", "bar", 1, 2, 3)'

Expand Down

0 comments on commit 711da95

Please sign in to comment.