Codebase list duktape / run/d5adf042-7cb5-49a1-8165-c22db32bcb72/main Makefile.dukdebug
run/d5adf042-7cb5-49a1-8165-c22db32bcb72/main

Tree @run/d5adf042-7cb5-49a1-8165-c22db32bcb72/main (Download .tar.gz)

Makefile.dukdebug @run/d5adf042-7cb5-49a1-8165-c22db32bcb72/mainraw · history · blame

#
#  Duktape command line tool with debugger support.
#

DUKTAPE_SOURCES = prep/duktape.c

# Windows (MinGW): use examples/debug-trans-socket/duk_trans_socket_windows.c
# and link with -lws2_32.
CMDLINE_SOURCES = \
	examples/cmdline/duk_cmdline.c \
	examples/debug-trans-socket/duk_trans_socket_unix.c

CC ?= gcc
CC := $(CC)
CCOPTS = -Os -pedantic -std=c99 -Wall -fstrict-aliasing -fomit-frame-pointer
CCOPTS += -I./prep -I./examples/cmdline -I./examples/debug-trans-socket
CCOPTS += -DDUK_CMDLINE_DEBUGGER_SUPPORT     # enable --debugger in ./duk
CCLIBS = -lm

# Enable a few optional modules.
CCOPTS += -DDUK_CMDLINE_PRINTALERT_SUPPORT -I./extras/print-alert
CMDLINE_SOURCES += extras/print-alert/duk_print_alert.c
CCOPTS += -DDUK_CMDLINE_CONSOLE_SUPPORT -I./extras/console
CMDLINE_SOURCES += extras/console/duk_console.c
CCOPTS += -DDUK_CMDLINE_LOGGING_SUPPORT -I./extras/logging
CMDLINE_SOURCES += extras/logging/duk_logging.c
CCOPTS += -DDUK_CMDLINE_MODULE_SUPPORT -I./extras/module-duktape
CMDLINE_SOURCES += extras/module-duktape/duk_module_duktape.c

# Use tools/configure.py to prepare Duktape config header and sources with
# custom configuration.
duk: $(CMDLINE_SOURCES)
	@rm -rf prep
	python2 tools/configure.py \
		--source-directory src-input \
		--output-directory prep \
		--config-metadata config \
		-DDUK_USE_DEBUGGER_SUPPORT \
		-DDUK_USE_INTERRUPT_COUNTER \
		-DDUK_USE_DEBUGGER_DUMPHEAP \
		-DDUK_USE_DEBUGGER_INSPECT
	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $(DEFINES) $(CCOPTS) $(DUKTAPE_SOURCES) $(CMDLINE_SOURCES) $(CCLIBS)