1#
2#  Duktape command line tool with debugger support.
3#
4
5DUKTAPE_SOURCES = src/duktape.c
6
7# Windows (MinGW): use examples/debug-trans-socket/duk_trans_socket_windows.c
8# and link with -lws2_32.
9DUKTAPE_CMDLINE_SOURCES = \
10	examples/cmdline/duk_cmdline.c \
11	examples/debug-trans-socket/duk_trans_socket_unix.c
12
13CC	= gcc
14CCOPTS	= -Os -pedantic -std=c99 -Wall -fstrict-aliasing -fomit-frame-pointer
15CCOPTS += -I./src -I./examples/debug-trans-socket
16CCOPTS += -DDUK_CMDLINE_DEBUGGER_SUPPORT     # enable --debugger in ./duk
17CCOPTS += -DDUK_OPT_DEBUGGER_SUPPORT         # enable debugger support in Duktape
18CCOPTS += -DDUK_OPT_INTERRUPT_COUNTER        # prerequisite for debugging
19CCOPTS += -DDUK_OPT_DEBUGGER_FWD_PRINTALERT  # optional debugger features
20CCOPTS += -DDUK_OPT_DEBUGGER_FWD_LOGGING
21CCOPTS += -DDUK_OPT_DEBUGGER_DUMPHEAP
22CCOPTS += -DDUK_OPT_DEBUGGER_INSPECT
23CCLIBS	= -lm
24
25duk:	$(DUKTAPE_SOURCES) $(DUKTAPE_CMDLINE_SOURCES)
26	$(CC) -o $@ $(DEFINES) $(CCOPTS) $(DUKTAPE_SOURCES) $(DUKTAPE_CMDLINE_SOURCES) $(CCLIBS)
27