]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | # |
2 | # Example Makefile for building a program with embedded Duktape. | |
3 | # The example program here is the Duktape command line tool. | |
4 | # | |
5 | ||
6 | DUKTAPE_SOURCES = src/duktape.c | |
7 | ||
8 | DUKTAPE_CMDLINE_SOURCES = \ | |
9 | examples/cmdline/duk_cmdline.c | |
10 | ||
11 | CC = gcc | |
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 | |
14 | CCLIBS = -lm | |
15 | ||
11fdf7f2 TL |
16 | # If you want linenoise, you can enable these. At the moment linenoise |
17 | # will cause some harmless compilation warnings. | |
7c673cae | 18 | #CCOPTS += -DDUK_CMDLINE_FANCY |
11fdf7f2 TL |
19 | #DUKTAPE_CMDLINE_SOURCES += linenoise/linenoise.c |
20 | #CCOPTS += -I./linenoise | |
21 | #duk: linenoise | |
7c673cae FG |
22 | |
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 | |
27 | # ... | |
28 | ||
29 | duk: $(DUKTAPE_SOURCES) $(DUKTAPE_CMDLINE_SOURCES) | |
30 | $(CC) -o $@ $(DEFINES) $(CCOPTS) $(DUKTAPE_SOURCES) $(DUKTAPE_CMDLINE_SOURCES) $(CCLIBS) | |
11fdf7f2 TL |
31 | |
32 | linenoise/linenoise.c: linenoise | |
33 | linenoise: | |
34 | git clone https://github.com/antirez/linenoise.git |