Makefile.cmdline 964 B

123456789101112131415161718192021222324252627282930
  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 have readline, you may want to enable these. On some platforms
  13. # -lreadline also requires -lncurses (e.g. RHEL), so it is added by default
  14. # (you may be able to remove it)
  15. #CCOPTS += -DDUK_CMDLINE_FANCY
  16. #CCLIBS += -lreadline
  17. #CCLIBS += -lncurses
  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)