<commit_before>#
# Copyright (C) 2015 <NAME> <<EMAIL>>
# Distributed under the terms of the MIT license.
#

LOCAL_DIR := $(abspath $(realpath $(dir $(lastword $(MAKEFILE_LIST)))))

EXEC ?= firmware.exe
PGM ?= ${ARCH}/$(EXEC)

MANAGERS ?= all

#
# Search for source files if the top-level makefile doesn't specify them explicitly
#
ifdef SRC_DIR
  ifeq ($(and $(CSRCS),$(CXXSRCS)),)
    CSRCS = $(wildcard $(SRC_DIR)/*.c)        \
            $(wildcard $(SRC_DIR)/*/*.c)      \
            $(wildcard $(SRC_DIR)/*/*/*.c)    \
            $(wildcard $(SRC_DIR)/*/*/*/*.c)  \
            $(wildcard $(SRC_DIR)/*/*/*/*/*.c)

    CXXSRCS = $(wildcard $(SRC_DIR)/*.cpp)        \
              $(wildcard $(SRC_DIR)/*/*.cpp)      \
              $(wildcard $(SRC_DIR)/*/*/*.cpp)    \
              $(wildcard $(SRC_DIR)/*/*/*/*.cpp)  \
              $(wildcard $(SRC_DIR)/*/*/*/*/*.cpp)
  endif
endif

#
# Common compiler flags
# Application specific flags are appended so the default flags can be overriden
#
common_flags = -Wall -Wextra -Werror -Wundef -pedantic -ffunction-sections -fdata-sections
AM_CFLAGS := $(common_flags) -std=c99 $(AM_CFLAGS)
AM_CXXFLAGS := $(common_flags) -std=c++11 -fno-exceptions -fno-rtti $(AM_CXXFLAGS)

AM_LDFLAGS := -Wl,--gc-sections $(AM_LDFLAGS)

#
# RTEMS makefiles
#
ifndef RTEMS_MAKEFILE_PATH
  $(error RTEMS environment is not configured. Have you sourced env.sh?)
endif

VARIANT ?= OPTIMIZE
ifeq ($(VARIANT),DEBUG)
else ifeq ($(VARIANT),OPTIMIZE)
else
  $(error Unrecognized build variant: $(VARIANT))<commit_msg>-fno-exceptions -fno-rtti to the linker<commit_after>#
# Copyright (C) 2015 <NAME> <<EMAIL>>
# Distributed under the terms of the MIT license.
#

LOCAL_DIR := $(abspath $(realpath $(dir $(lastword $(MAKEFILE_LIST)))))

EXEC ?= firmware.exe
PGM ?= ${ARCH}/$(EXEC)

MANAGERS ?= all

#
# Search for source files if the top-level makefile doesn't specify them explicitly
#
ifdef SRC_DIR
  ifeq ($(and $(CSRCS),$(CXXSRCS)),)
    CSRCS = $(wildcard $(SRC_DIR)/*.c)        \
            $(wildcard $(SRC_DIR)/*/*.c)      \
            $(wildcard $(SRC_DIR)/*/*/*.c)    \
            $(wildcard $(SRC_DIR)/*/*/*/*.c)  \
            $(wildcard $(SRC_DIR)/*/*/*/*/*.c)

    CXXSRCS = $(wildcard $(SRC_DIR)/*.cpp)        \
              $(wildcard $(SRC_DIR)/*/*.cpp)      \
              $(wildcard $(SRC_DIR)/*/*/*.cpp)    \
              $(wildcard $(SRC_DIR)/*/*/*/*.cpp)  \
              $(wildcard $(SRC_DIR)/*/*/*/*/*.cpp)
  endif
endif

#
# Common compiler flags
# Application specific flags are appended so the default flags can be overriden
#
common_flags = -Wall -Wextra -Werror -Wundef -pedantic -ffunction-sections -fdata-sections
AM_CFLAGS := $(common_flags) -std=c99 $(AM_CFLAGS)
AM_CXXFLAGS := $(common_flags) -std=c++11 -fno-exceptions -fno-rtti $(AM_CXXFLAGS)

AM_LDFLAGS := -fno-exceptions -fno-rtti -Wl,--gc-sections $(AM_LDFLAGS)

#
# RTEMS makefiles
#
ifndef RTEMS_MAKEFILE_PATH
  $(error RTEMS environment is not configured. Have you sourced env.sh?)
endif

VARIANT ?= OPTIMIZE
ifeq ($(VARIANT),DEBUG)
else ifeq ($(VARIANT),OPTIMIZE)
else
  $(error Unrecognized build variant: $(VARIANT))
{'fraction_non_alphanumeric': 0.18360864040660738, 'fraction_numerical': 0.005082592121982211, 'mean_word_length': 2.902106567534077, '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': '5645866', 'n_tokens_mistral': 1180, 'n_tokens_neox': 1103, 'n_words': 267}