Makefile.in-duktape 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #
  2. # Copyright (c) 2015-2017 the Civetweb developers
  3. #
  4. # License http://opensource.org/licenses/mit-license.php MIT License
  5. #
  6. ifndef WITH_DUKTAPE
  7. $(error WITH_DUKTAPE is not defined)
  8. endif
  9. # Duktape default version is 1.5.2 (105)
  10. WITH_DUKTAPE_VERSION ?= 105
  11. DUKTAPE_VERSION_KNOWN = 0
  12. # Select src and header according to the Duktape version
  13. ifeq ($(WITH_DUKTAPE_VERSION), 105)
  14. $(info Duktape: Using version 1.5.2)
  15. DUKTAPE_DIR = src/third_party/duktape-1.5.2/src
  16. DUKTAPE_SHARED_LIB_FLAG = -lduktape1.5
  17. DUKTAPE_CFLAGS = -DDUKTAPE_VERSION_MAKEFILE=105
  18. DUKTAPE_VERSION_KNOWN = 1
  19. endif
  20. ifneq ($(DUKTAPE_VERSION_KNOWN), 1)
  21. $(error Duktape: Unknwon version - $(WITH_DUKTAPE_VERSION))
  22. endif
  23. # Add flags for all Duktape versions
  24. DUKTAPE_CFLAGS += -I$(DUKTAPE_DIR) -DUSE_DUKTAPE
  25. ifneq ($(TARGET_OS),WIN32)
  26. # DUKTAPE_CFLAGS +=
  27. endif
  28. ifdef WITH_DUKTAPE_SHARED
  29. DUKTAPE_SOURCE_FILES =
  30. $(info Duktape: using dynamic linking)
  31. else
  32. DUKTAPE_SOURCE_FILES = duktape.c
  33. ifeq ($(WITH_DUKTAPE_VERSION), 104)
  34. # DUKTAPE_SOURCE_FILES += ... TODO ...
  35. endif
  36. $(info Duktape: using static library)
  37. endif
  38. DUKTAPE_SOURCES = $(addprefix $(DUKTAPE_DIR)/, $(DUKTAPE_SOURCE_FILES))
  39. DUKTAPE_OBJECTS = $(DUKTAPE_SOURCES:.c=.o)
  40. OBJECTS += $(DUKTAPE_OBJECTS)
  41. CFLAGS += $(DUKTAPE_CFLAGS)
  42. SOURCE_DIRS = $(DUKTAPE_DIR)