Makefile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. include ../../py/mkenv.mk
  2. -include mpconfigport.mk
  3. # define main target
  4. PROG = micropython.exe
  5. # qstr definitions (must come before including py.mk)
  6. QSTR_DEFS = ../unix/qstrdefsport.h
  7. # include py core make definitions
  8. include $(TOP)/py/py.mk
  9. INC += -I.
  10. INC += -I$(TOP)
  11. INC += -I$(BUILD)
  12. # compiler settings
  13. CFLAGS = $(INC) -Wall -Wpointer-arith -Werror -std=gnu99 -DUNIX -D__USE_MINGW_ANSI_STDIO=1 $(CFLAGS_MOD) $(COPT)
  14. LDFLAGS = $(LDFLAGS_MOD) -lm
  15. # Debugging/Optimization
  16. ifdef DEBUG
  17. CFLAGS += -g
  18. COPT = -O0
  19. else
  20. COPT = -Os #-DNDEBUG
  21. endif
  22. # source files
  23. SRC_C = \
  24. lib/utils/printf.c \
  25. ports/unix/main.c \
  26. ports/unix/file.c \
  27. ports/unix/input.c \
  28. ports/unix/modos.c \
  29. ports/unix/modmachine.c \
  30. ports/unix/modtime.c \
  31. ports/unix/gccollect.c \
  32. windows_mphal.c \
  33. realpath.c \
  34. init.c \
  35. sleep.c \
  36. OBJ = $(PY_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
  37. ifeq ($(MICROPY_USE_READLINE),1)
  38. CFLAGS_MOD += -DMICROPY_USE_READLINE=1
  39. SRC_C += lib/mp-readline/readline.c
  40. else ifeq ($(MICROPY_USE_READLINE),2)
  41. CFLAGS_MOD += -DMICROPY_USE_READLINE=2
  42. LDFLAGS_MOD += -lreadline
  43. endif
  44. LIB += -lws2_32
  45. # List of sources for qstr extraction
  46. SRC_QSTR += $(SRC_C)
  47. # Append any auto-generated sources that are needed by sources listed in
  48. # SRC_QSTR
  49. SRC_QSTR_AUTO_DEPS +=
  50. include $(TOP)/py/mkrules.mk