<commit_before># userland master makefile. Included by application makefiles

# The first target Make finds is its default. So this line needs to be first to
# specify `all` as our default rule
all:

# directory for built output
BUILDDIR ?= build

# Build settings
include $(TOCK_USERLAND_BASE_DIR)/Configuration.mk

# Helper functions
include $(TOCK_USERLAND_BASE_DIR)/Helpers.mk

# Include the libtock makefile. Adds rules that will rebuild library when needed
include $(TOCK_USERLAND_BASE_DIR)/libtock/Makefile

# Connection to the Tock kernel. Apps need the ability to be loaded onto a
# board, and that method is board-specific. So for now, we have the TOCK_BOARD
# variable which selects one and we include the appropriate Makefile-app from
# within the Tock base directory.
TOCK_BOARD ?= hail

# Include the makefile that has the programming functions for each board.
include $(TOCK_USERLAND_BASE_DIR)/Program.mk



# Rules to incorporate external libraries
define EXTERN_LIB_RULES
EXTERN_LIB_NAME_$(notdir $(1)) := $(notdir $(1))

# If this library has any additional rules, add them
-include $(1)/Makefile.app

# If this library has an include directory, add it to search path
ifneq "$$(wildcard $(1)/include)" ""
  override CPPFLAGS += -I$(1)/include
endif

# Add arch-specific rules for each library
# Use the $(LIBNAME)_BUILDDIR as build directory, if set.
$$(notdir $(1))_BUILDDIR ?= $(1)/build
$$(foreach arch, $$(TOCK_ARCHS), $$(eval LIBS_$$(arch) += $$($(notdir $(1))_BUILDDIR)/$$(arch)/$(notdir $(1)).a))

endef

# To see the generated rules, run:
# $(info $(foreach lib, $(EXTERN_LIBS), $(call EXTERN_LIB_RULES,$(lib))))
$(foreach lib, $(EXTERN_LIBS), $(eval $(call EXTERN_LIB_RULES,$(lib))))


# Some sanity checks for variables before they are used

# Warn users about LDFLAGS currently being ignored. We currently use the WLFLAGS
# and WLFLAGS_$(march) variables to pass linker options through the compiler,
# by encoding them as `-Wl,...` options.
ifdef LDFLAGS
  $(warning *******************************************************)
  $(warning LDFLAGS are currently ignored!!)
  $(warning )
  $(warning This is because we need to invoke the gcc frontend not the)
  $(warning ld frontend for the final link step, which means that we would)
  $(warning need to parse the LDFLAGS into things like -Wl,-<flag> for each)
  $(warning entry, but that proved a little fragile on first attempt so)
  $(warning it is not currently done. Sorry.)
  $(warning *******************************************************)
endif

# Warn users about improperly defined HEAP_SIZE
ifdef HEAP_SIZE
    $(warning The variable HEAP_SIZE is set but will not be used.)
    $(warning Tock has two heaps, the application heap which is memory your program)
    $(warning uses and the kernel heap or grant regions, which is memory dynamically)
    $(warning allocated by drivers on behalf of your program.)
    $(warning )
    $(warning These regions are controlled by the APP_HEAP_SIZE and KERNEL_HEAP_SIZE)
    $(warning variables respectively.)
endif


# Rules to create object files for a specific architecture.
#
# - Argument $(1) is the architecture (e.g. cortex-m0) to compile for.
define BUILD_RULES_PER_ARCH

# BUILDDIR holds architecture dependent, but board-independent outputs
$$(BUILDDIR)/$(1):
	$$(TRACE_DIR)
	$$(Q)mkdir -p $$@

# First step doesn't actually compile, just generate header dependency information<commit_msg>add pointer to WLFLAGS to the printed warning<commit_after># userland master makefile. Included by application makefiles

# The first target Make finds is its default. So this line needs to be first to
# specify `all` as our default rule
all:

# directory for built output
BUILDDIR ?= build

# Build settings
include $(TOCK_USERLAND_BASE_DIR)/Configuration.mk

# Helper functions
include $(TOCK_USERLAND_BASE_DIR)/Helpers.mk

# Include the libtock makefile. Adds rules that will rebuild library when needed
include $(TOCK_USERLAND_BASE_DIR)/libtock/Makefile

# Connection to the Tock kernel. Apps need the ability to be loaded onto a
# board, and that method is board-specific. So for now, we have the TOCK_BOARD
# variable which selects one and we include the appropriate Makefile-app from
# within the Tock base directory.
TOCK_BOARD ?= hail

# Include the makefile that has the programming functions for each board.
include $(TOCK_USERLAND_BASE_DIR)/Program.mk



# Rules to incorporate external libraries
define EXTERN_LIB_RULES
EXTERN_LIB_NAME_$(notdir $(1)) := $(notdir $(1))

# If this library has any additional rules, add them
-include $(1)/Makefile.app

# If this library has an include directory, add it to search path
ifneq "$$(wildcard $(1)/include)" ""
  override CPPFLAGS += -I$(1)/include
endif

# Add arch-specific rules for each library
# Use the $(LIBNAME)_BUILDDIR as build directory, if set.
$$(notdir $(1))_BUILDDIR ?= $(1)/build
$$(foreach arch, $$(TOCK_ARCHS), $$(eval LIBS_$$(arch) += $$($(notdir $(1))_BUILDDIR)/$$(arch)/$(notdir $(1)).a))

endef

# To see the generated rules, run:
# $(info $(foreach lib, $(EXTERN_LIBS), $(call EXTERN_LIB_RULES,$(lib))))
$(foreach lib, $(EXTERN_LIBS), $(eval $(call EXTERN_LIB_RULES,$(lib))))


# Some sanity checks for variables before they are used

# Warn users about LDFLAGS currently being ignored. We currently use the WLFLAGS
# and WLFLAGS_$(march) variables to pass linker options through the compiler,
# by encoding them as `-Wl,...` options.
ifdef LDFLAGS
  $(warning *******************************************************)
  $(warning LDFLAGS are currently ignored!!)
  $(warning )
  $(warning This is because we need to invoke the gcc frontend not the)
  $(warning ld frontend for the final link step, which means that we would)
  $(warning need to parse the LDFLAGS into things like -Wl,-<flag> for each)
  $(warning entry, but that proved a little fragile on first attempt so)
  $(warning it is not currently done. Sorry.)
  $(warning Please use WLFLAGS if you need to pass linker flags.)
  $(warning *******************************************************)
endif

# Warn users about improperly defined HEAP_SIZE
ifdef HEAP_SIZE
    $(warning The variable HEAP_SIZE is set but will not be used.)
    $(warning Tock has two heaps, the application heap which is memory your program)
    $(warning uses and the kernel heap or grant regions, which is memory dynamically)
    $(warning allocated by drivers on behalf of your program.)
    $(warning )
    $(warning These regions are controlled by the APP_HEAP_SIZE and KERNEL_HEAP_SIZE)
    $(warning variables respectively.)
endif


# Rules to create object files for a specific architecture.
#
# - Argument $(1) is the architecture (e.g. cortex-m0) to compile for.
define BUILD_RULES_PER_ARCH

# BUILDDIR holds architecture dependent, but board-independent outputs
$$(BUILDDIR)/$(1):
	$$(TRACE_DIR)
	$$(Q)mkdir -p $$@

# First step doesn't actually compile, just generate header dependency information
{'fraction_non_alphanumeric': 0.12543153049482164, 'fraction_numerical': 0.0034522439585730723, 'mean_word_length': 4.86256323777403, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2074704', 'n_tokens_mistral': 2024, 'n_tokens_neox': 1966, 'n_words': 853}