<commit_before>#
# <NAME>, 2014 <<EMAIL>>
#

CPPSRC := $(wildcard src/*.cpp)                  \
          $(wildcard src/sys/*.cpp)

CSRC   := $(wildcard lpc_chip_11cxx_lib/src/*.c) \
          $(wildcard src/sys/*.c)

DEF =

INC = -Isrc/sys                         \
      -Ilpc_chip_11cxx_lib/inc

#
# UAVCAN library
#

DEF += -DUAVCAN_MEM_POOL_BLOCK_SIZE=56  \
       -DUAVCAN_TOSTRING=0              \
       -DUAVCAN_EXCEPTIONS=0            \
       -DUAVCAN_TINY=1

include ../../../libuavcan/include.mk
CPPSRC += $(LIBUAVCAN_SRC)
INC += -I$(LIBUAVCAN_INC)

include ../driver/include.mk
CPPSRC += $(LIBUAVCAN_LPC11C24_SRC)
INC += -I$(LIBUAVCAN_LPC11C24_INC)

# TODO: add target for this
$(info $(shell $(LIBUAVCAN_DSDLC) $(UAVCAN_DSDL_DIR)))
INC += -Idsdlc_generated

#
# Build configuration
#

BUILDDIR = build
OBJDIR = $(BUILDDIR)/obj
DEPDIR = $(BUILDDIR)/dep

DEF += -DNDEBUG -DCHIP_LPC11CXX -DCORE_M0 -DTHUMB_NO_INTERWORKING

FLAGS = -mthumb -mcpu=cortex-m0 -mno-thumb-interwork

C_CPP_FLAGS = $(FLAGS) -Os -g3 -Wall -Wextra -Werror -ffunction-sections -fdata-sections \
              -fno-common -fno-exceptions -fno-unwind-tables -fno-stack-protector -fomit-frame-pointer

# Dependencies
C_CPP_FLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d

CFLAGS = $(C_CPP_FLAGS) -std=c99

CPPFLAGS = $(C_CPP_FLAGS) -pedantic -std=c++11 -fno-rtti -fno-threadsafe-statics

LDFLAGS = $(FLAGS) -nodefaultlibs -lc -lgcc -nostartfiles -Tlpc11c24.ld -Xlinker --gc-sections \
          -Wl,-Map,$(BUILDDIR)/output.map
<commit_msg>LPC11C24: Using --specs=nano.specs (link with small newlib)<commit_after>#
# <NAME>, 2014 <<EMAIL>>
#

CPPSRC := $(wildcard src/*.cpp)                  \
          $(wildcard src/sys/*.cpp)

CSRC   := $(wildcard lpc_chip_11cxx_lib/src/*.c) \
          $(wildcard src/sys/*.c)

DEF =

INC = -Isrc/sys                         \
      -Ilpc_chip_11cxx_lib/inc

#
# UAVCAN library
#

DEF += -DUAVCAN_MEM_POOL_BLOCK_SIZE=56  \
       -DUAVCAN_TOSTRING=0              \
       -DUAVCAN_EXCEPTIONS=0            \
       -DUAVCAN_TINY=1

include ../../../libuavcan/include.mk
CPPSRC += $(LIBUAVCAN_SRC)
INC += -I$(LIBUAVCAN_INC)

include ../driver/include.mk
CPPSRC += $(LIBUAVCAN_LPC11C24_SRC)
INC += -I$(LIBUAVCAN_LPC11C24_INC)

# TODO: add target for this
$(info $(shell $(LIBUAVCAN_DSDLC) $(UAVCAN_DSDL_DIR)))
INC += -Idsdlc_generated

#
# Build configuration
#

BUILDDIR = build
OBJDIR = $(BUILDDIR)/obj
DEPDIR = $(BUILDDIR)/dep

DEF += -DNDEBUG -DCHIP_LPC11CXX -DCORE_M0 -DTHUMB_NO_INTERWORKING

FLAGS = -mthumb -mcpu=cortex-m0 -mno-thumb-interwork

C_CPP_FLAGS = $(FLAGS) -Os -g3 -Wall -Wextra -Werror -ffunction-sections -fdata-sections \
              -fno-common -fno-exceptions -fno-unwind-tables -fno-stack-protector -fomit-frame-pointer

# Dependencies
C_CPP_FLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d

CFLAGS = $(C_CPP_FLAGS) -std=c99

CPPFLAGS = $(C_CPP_FLAGS) -pedantic -std=c++11 -fno-rtti -fno-threadsafe-statics

LDFLAGS = $(FLAGS) -nodefaultlibs -lc -lgcc -nostartfiles -Tlpc11c24.ld -Xlinker --gc-sections \
          -Wl,-Map,$(BUILDDIR)/output.map

# Link with nano newlib. Other toolchains may not support this option, so it can be safely removed.
LDFLAGS += --specs=nano.specs

{'fraction_non_alphanumeric': 0.15391820168591944, 'fraction_numerical': 0.02247892600686856, 'mean_word_length': 2.7738515901060072, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5626321', 'n_tokens_mistral': 1373, 'n_tokens_neox': 1307, 'n_words': 233}