Skip to content
Snippets Groups Projects
Select Git revision
  • b440307b4a15a540413a7a9f699d388c7428a63c
  • wip-bootstrap default
  • dualcore
  • ch3/leds
  • ch3/time
  • master
6 results

py.mk

Blame
  • py.mk 7.60 KiB
    # where py object files go (they have a name prefix to prevent filename clashes)
    PY_BUILD = $(BUILD)/py
    
    # where autogenerated header files go
    HEADER_BUILD = $(BUILD)/genhdr
    
    # file containing qstr defs for the core Python bit
    PY_QSTR_DEFS = $(PY_SRC)/qstrdefs.h
    
    # If qstr autogeneration is not disabled we specify the output header
    # for all collected qstrings.
    ifneq ($(QSTR_AUTOGEN_DISABLE),1)
    QSTR_DEFS_COLLECTED = $(HEADER_BUILD)/qstrdefs.collected.h
    endif
    
    # some code is performance bottleneck and compiled with other optimization options
    CSUPEROPT = -O3
    
    INC += -I../lib
    INC += -I../lib/netutils
    
    ifeq ($(MICROPY_PY_USSL),1)
    CFLAGS_MOD += -DMICROPY_PY_USSL=1
    ifeq ($(MICROPY_SSL_AXTLS),1)
    CFLAGS_MOD += -DMICROPY_SSL_AXTLS=1 -I../lib/axtls/ssl -I../lib/axtls/crypto -I../lib/axtls/config
    LDFLAGS_MOD += -Lbuild -laxtls
    else ifeq ($(MICROPY_SSL_MBEDTLS),1)
    # Can be overriden by ports which have "builtin" mbedTLS
    MICROPY_SSL_MBEDTLS_INCLUDE ?= ../lib/mbedtls/include
    CFLAGS_MOD += -DMICROPY_SSL_MBEDTLS=1 -I$(MICROPY_SSL_MBEDTLS_INCLUDE)
    LDFLAGS_MOD += -L../lib/mbedtls/library -lmbedx509 -lmbedtls -lmbedcrypto
    endif
    endif
    
    #ifeq ($(MICROPY_PY_LWIP),1)
    #CFLAGS_MOD += -DMICROPY_PY_LWIP=1 -I../lib/lwip/src/include -I../lib/lwip/src/include/ipv4 -I../extmod/lwip-include
    #endif
    
    ifeq ($(MICROPY_PY_LWIP),1)
    LWIP_DIR = lib/lwip/src
    INC += -I../lib/lwip/src/include -I../lib/lwip/src/include/ipv4 -I../extmod/lwip-include
    CFLAGS_MOD += -DMICROPY_PY_LWIP=1
    SRC_MOD += extmod/modlwip.c lib/netutils/netutils.c
    SRC_MOD += $(addprefix $(LWIP_DIR)/,\
    	core/def.c \
    	core/dns.c \
    	core/init.c \
    	core/mem.c \
    	core/memp.c \
    	core/netif.c \
    	core/pbuf.c \
    	core/raw.c \
    	core/stats.c \
    	core/sys.c \
    	core/tcp.c \
    	core/tcp_in.c \
    	core/tcp_out.c \
    	core/timers.c \
    	core/udp.c \
    	core/ipv4/autoip.c \
    	core/ipv4/icmp.c \
    	core/ipv4/igmp.c \
    	core/ipv4/inet.c \
    	core/ipv4/inet_chksum.c \
    	core/ipv4/ip_addr.c \
    	core/ipv4/ip.c \
    	core/ipv4/ip_frag.c \
    	)
    ifeq ($(MICROPY_PY_LWIP_SLIP),1)
    CFLAGS_MOD += -DMICROPY_PY_LWIP_SLIP=1