Makefile.cmdline 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. #
  2. # Example Makefile for building a program with embedded Duktape.
  3. # The example program here is the Duktape command line tool.
  4. #
  5. DUKTAPE_SOURCES = src/duktape.c
  6. DUKTAPE_CMDLINE_SOURCES = \
  7. examples/cmdline/duk_cmdline.c
  8. CC = gcc
  9. CCOPTS = -Os -pedantic -std=c99 -Wall -fstrict-aliasing -fomit-frame-pointer
  10. CCOPTS += -I./src # duktape.h and duk_config.h must be in include path
  11. CCLIBS = -lm
  12. # If you want linenoise, you can enable these. At the moment linenoise
  13. # will cause some harmless compilation warnings.
  14. #CCOPTS += -DDUK_CMDLINE_FANCY
  15. #DUKTAPE_CMDLINE_SOURCES += linenoise/linenoise.c
  16. #CCOPTS += -I./linenoise
  17. #duk: linenoise
  18. # Optional feature defines, see: http://duktape.org/guide.html#compiling
  19. CCOPTS += -DDUK_OPT_SELF_TESTS
  20. #CCOPTS += -DDUK_OPT_DEBUG
  21. #CCOPTS += -DDUK_OPT_DPRINT
  22. # ...
  23. duk: $(DUKTAPE_SOURCES) $(DUKTAPE_CMDLINE_SOURCES)
  24. $(CC) -o $@ $(DEFINES) $(CCOPTS) $(DUKTAPE_SOURCES) $(DUKTAPE_CMDLINE_SOURCES) $(CCLIBS)
  25. linenoise/linenoise.c: linenoise
  26. linenoise:
  27. git clone https://github.com/antirez/linenoise.git