File: Makefile

package info (click to toggle)
duktape 2.7.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 21,160 kB
  • sloc: ansic: 215,359; python: 5,961; javascript: 4,555; makefile: 477; cpp: 205
file content (42 lines) | stat: -rw-r--r-- 1,328 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# For manual testing; say 'make' in extras/alloc-pool and run ./test.

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

.PHONY: test
test:
	rm -rf ./prep
	echo 'DUK_USE_FATAL_HANDLER:' > opts.yaml
	echo '  verbatim: "#define DUK_USE_FATAL_HANDLER(udata,msg) my_fatal((msg))"' >> opts.yaml
	python2 ../../tools/configure.py \
		--output-directory ./prep \
		--option-file ./opts.yaml \
		--fixup-line 'extern void my_fatal(const char *msg);'
	$(CC) -std=c99 -Wall -Wextra -m32 -Os -otest \
		-I./prep ./prep/duktape.c \
		$(DEFS) \
		duk_alloc_pool.c test.c \
		-lm
	./test 'print("foo", "bar", 1, 2, 3)'
	./test 'alert("foo", "bar", 1, 2, 3)'

.PHONY: ptrcomptest
ptrcomptest:
	rm -rf ./prep
	echo 'DUK_USE_FATAL_HANDLER:' > opts.yaml
	echo '  verbatim: "#define DUK_USE_FATAL_HANDLER(udata,msg) my_fatal((msg))"' >> opts.yaml
	python2 ../../tools/configure.py \
		--output-directory ./prep \
		--option-file ./opts.yaml \
		--fixup-line 'extern void my_fatal(const char *msg);' \
		--option-file ../../config/examples/low_memory.yaml \
		--option-file ptrcomp.yaml \
		--fixup-file ptrcomp_fixup.h
	$(CC) -std=c99 -Wall -Wextra -m32 -Os -optrcomptest \
		-I. -I./prep ./prep/duktape.c \
		$(DEFS) \
		duk_alloc_pool.c test.c \
		-lm
	./ptrcomptest 'print("foo", "bar", 1, 2, 3)'
	./ptrcomptest 'alert("foo", "bar", 1, 2, 3)'