Skip to content
Snippets Groups Projects
Select Git revision
  • cbea5657026f2c9823f2f51a68a701e185930fe9
  • master default protected
  • blink_multi_rocket
  • blink_rocket
  • msgctl/gfx_rle
  • msgctl/faultscreen
  • msgctl/textbuffer_api
  • schneider/bonding
  • schneider/bootloader-update-9a0d158
  • schneider/bsec
  • rahix/bma
  • rahix/bhi
  • schleicher-test
  • schneider/schleicher-test
  • freertos-btle
  • ch3/api-speed-eval2
  • schneider/mp-for-old-bl
  • ch3/leds-api
  • ch3/genapi-refactor
  • ch3/dual-core
  • dualcore
  • v0.0
22 results

meson.build

Blame
  • Forked from card10 / firmware
    Source project has a limited visibility.
    Makefile 1.62 KiB
    include ../py/mkenv.mk
    -include mpconfigport.mk
    
    # define main target
    PROG = micropython
    
    # qstr definitions (must come before including py.mk)
    QSTR_DEFS = qstrdefsport.h
    
    # include py core make definitions
    include ../py/py.mk
    
    INC =  -I.
    INC += -I$(PY_SRC)
    INC += -I$(BUILD)
    
    # compiler settings
    CFLAGS = $(INC) -Wall -Werror -ansi -std=gnu99 -DUNIX $(CFLAGS_MOD) $(COPT)
    
    UNAME_S := $(shell uname -s)
     ifeq ($(UNAME_S),Darwin)
        LDFLAGS = $(LDFLAGS_MOD) -lm -Wl,-map,$@.map
    else
        LDFLAGS = $(LDFLAGS_MOD) -lm -Wl,-Map=$@.map,--cref
     endif
    
    ifeq ($(MICROPY_FORCE_32BIT),1)
    CFLAGS += -m32
    LDFLAGS += -m32
    ifeq ($(MICROPY_MOD_FFI),1)
    ifeq ($(UNAME_S),Linux)
    CFLAGS_MOD += -I/usr/include/i686-linux-gnu
    endif
    endif
    endif
    
    ifeq ($(MICROPY_USE_READLINE),1)
    CFLAGS_MOD += -DMICROPY_USE_READLINE=1
    LDFLAGS_MOD += -lreadline
    # the following is needed for BSD
    #LDFLAGS_MOD += -ltermcap
    endif
    ifeq ($(MICROPY_MOD_TIME),1)
    CFLAGS_MOD += -DMICROPY_MOD_TIME=1
    SRC_MOD += modtime.c
    endif
    ifeq ($(MICROPY_MOD_FFI),1)
    LIBFFI_LDFLAGS_MOD := $(shell pkg-config --libs libffi)
    LIBFFI_CFLAGS_MOD := $(shell pkg-config --cflags libffi)
    CFLAGS_MOD += $(LIBFFI_CFLAGS_MOD) -DMICROPY_MOD_FFI=1
    LDFLAGS_MOD += -ldl $(LIBFFI_LDFLAGS_MOD)
    SRC_MOD += modffi.c
    endif
    
    
    # Debugging/Optimization
    ifdef DEBUG
    CFLAGS += -g
    COPT = -O0
    else
    COPT = -Os #-DNDEBUG
    endif
    
    # source files
    SRC_C = \
    	main.c \
    	gccollect.c \
    	file.c \
    	modsocket.c \
    	$(SRC_MOD)
    
    OBJ = $(PY_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
    
    include ../py/mkrules.mk
    
    .PHONY: test
    
    test: $(PROG) ../tests/run-tests
    	$(eval DIRNAME=$(notdir $(CURDIR)))
    	cd ../tests && MICROPY_MICROPYTHON=../$(DIRNAME)/$(PROG) ./run-tests