2 # Example Makefile for building a program with embedded Duktape.
3 # The example program here is the Duktape command line tool.
6 DUKTAPE_SOURCES = src/duktape.c
8 DUKTAPE_CMDLINE_SOURCES = \
9 examples/cmdline/duk_cmdline.c
12 CCOPTS = -Os -pedantic -std=c99 -Wall -fstrict-aliasing -fomit-frame-pointer
13 CCOPTS += -I./src # duktape.h and duk_config.h must be in include path
16 # If you have readline, you may want to enable these. On some platforms
17 # -lreadline also requires -lncurses (e.g. RHEL), so it is added by default
18 # (you may be able to remove it)
19 #CCOPTS += -DDUK_CMDLINE_FANCY
23 # Optional feature defines, see: http://duktape.org/guide.html#compiling
24 CCOPTS += -DDUK_OPT_SELF_TESTS
25 #CCOPTS += -DDUK_OPT_DEBUG
26 #CCOPTS += -DDUK_OPT_DPRINT
29 duk: $(DUKTAPE_SOURCES) $(DUKTAPE_CMDLINE_SOURCES)
30 $(CC) -o $@ $(DEFINES) $(CCOPTS) $(DUKTAPE_SOURCES) $(DUKTAPE_CMDLINE_SOURCES) $(CCLIBS)