<commit_before># Default settings (silent debug build).
LIB_EXT ?= a
BUILD_FLAGS = -mcx16 -march=native -Werror -Wall
LINKER_FLAGS =
ALL_CFLAGS = -std=gnu11
ALL_CXXFLAGS = -std=gnu++11

ifeq ($(config),release)
  BUILD_FLAGS += -O3 -DNDEBUG
  LINKER_FLAGS += -fuse-ld=gold
  DEFINES +=
else
  config = debug
  BUILD_FLAGS += -g -DDEBUG
endif

PONY_BUILD_DIR   ?= build/$(config)
PONY_SOURCE_DIR  ?= src
PONY_TEST_DIR ?= test

lib   := $(PONY_BUILD_DIR)
bin   := $(PONY_BUILD_DIR)
tests := $(PONY_BUILD_DIR)

$(shell mkdir -p $(lib))
#$(shell mkdir -p $(bin))
#$(shell mkdir -p $(tests))

obj  := $(PONY_BUILD_DIR)/obj

# Libraries. Defined as
# (1) a name and output directory
libponyc  := $(lib)
libponycc := $(lib)
libponyrt := $(lib)

# Define special case rules for a targets source files. By default
# this makefile assumes that a targets source files can be found
# relative to a parent directory of the same name in $(PONY_SOURCE_DIR).
# Note that it is possible to collect files and exceptions with
# arbitrarily complex shell commands, as long as ':=' is used
# for definition, instead of '='.
libponycc.dir := src/libponyc
libponycc.files := src/libponyc/debug/dwarf.cc
libponycc.files += src/libponyc/debug/symbols.cc
libponycc.files += src/libponyc/codegen/host.cc

libponyc.except := $(libponycc.files)
libponyc.except += src/libponyc/platform/signed.cc
libponyc.except += src/libponyc/platform/unsigned.cc
libponyc.except += src/libponyc/platform/vcvars.c

# Third party, but requires compilation. Defined as
# (1) a name and output directory.
# (2) a list of the source files to be compiled.
libgtest := $(lib)
libgtest.dir := lib/gtest
libgtest.files := $(libgtest.dir)/gtest_main.cc $(libgtest.dir)/gtest-all.cc

libraries := libponyc libponycc libponyrt libgtest

# Third party, but prebuilt. Prebuilt libraries are defined as
# (1) a name (stored in prebuilt)
# (2) the linker flags necessary to link against the prebuilt library/libraries.
# (3) a list of include directories for a set of libraries.
# (4) a list of the libraries to link against.
llvm.ldflags := $(shell llvm-config-3.5 --ldflags)
llvm.include := $(shell llvm-config-3.5 --includedir)
llvm.libs    := $(shell llvm-config-3.5 --libs) -lz -lcurses

prebuilt := llvm

# Binaries. Defined as<commit_msg>added support for platform specific excepts<commit_after># Determine the operating system
OSTYPE ?=

ifeq ($(OS),Windows_NT)
  OSTYPE = windows
else
  UNAME_S := $(shell uname -s)
  ifeq ($(UNAME_S),Linux)
    OSTYPE = linux
  endif

  ifeq ($(UNAME_S),Darwin)
    OSTYPE = osx
  endif
endif

# Default settings (silent debug build).
LIB_EXT ?= a
BUILD_FLAGS = -mcx16 -march=native -Werror -Wall
LINKER_FLAGS =
ALL_CFLAGS = -std=gnu11
ALL_CXXFLAGS = -std=gnu++11

ifeq ($(config),release)
  BUILD_FLAGS += -O3 -DNDEBUG
  LINKER_FLAGS += -fuse-ld=gold
  DEFINES +=
else
  config = debug
  BUILD_FLAGS += -g -DDEBUG
endif

PONY_BUILD_DIR   ?= build/$(config)
PONY_SOURCE_DIR  ?= src
PONY_TEST_DIR ?= test

lib   := $(PONY_BUILD_DIR)
bin   := $(PONY_BUILD_DIR)
tests := $(PONY_BUILD_DIR)

$(shell mkdir -p $(lib))
#$(shell mkdir -p $(bin))
#$(shell mkdir -p $(tests))

obj  := $(PONY_BUILD_DIR)/obj

# Libraries. Defined as
# (1) a name and output directory
libponyc  := $(lib)
libponycc := $(lib)
libponyrt := $(lib)

# Define special case rules for a targets source files. By default
# this makefile assumes that a targets source files can be found
# relative to a parent directory of the same name in $(PONY_SOURCE_DIR).
# Note that it is possible to collect files and exceptions with
# arbitrarily complex shell commands, as long as ':=' is used
# for definition, instead of '='.
libponycc.dir := src/libponyc
libponycc.files := src/libponyc/debug/dwarf.cc
libponycc.files += src/libponyc/debug/symbols.cc
libponycc.files += src/libponyc/codegen/host.cc

libponyc.except := $(libponycc.files)
libponyc.except += src/libponyc/platform/signed.cc
libponyc.except += src/libponyc/platform/unsigned.cc
libponyc.except += src/libponyc/platform/vcvars.c

# Handle platform specific code to avoid "no symbols" warnings.
libponyrt.except =

ifneq ($(OSTYPE),windows)
  libponyrt.except += src/libponyrt/asio/iocp.c
  libponyrt.except += src/libponyrt/lang/win_except.c
endif

ifeq ($(OSTYPE),linux)
  libponyrt.except += src/libponyrt/asio/kqueue.c
endif

ifeq ($(OSTYPE),osx)
  libponyrt.except += src/libponyrt/asio/epoll.c
endif

# Third party, but requires compilation. Defined as
# (1) a name and output directory.
# (2) a list of the source files to be compiled.
libgtest := $(lib)
libgtest.dir := lib/gtest
libgtest.files := $(libgtest.dir)/gtest_main.cc $(libgtest.dir)/gtest-all.cc

libraries := libponyc libponycc libponyrt libgtest

# Third party, but prebuilt. Prebuilt libraries are defined as
# (1) a name (stored in prebuilt)
# (2) the linker flags necessary to link against the prebuilt library/libraries.
# (3) a list of include directories for a set of libraries.
# (4) a list of the libraries to link against.
llvm.ldflags := $(shell llvm-config-3.5 --ldflags)
llvm.include := $(shell llvm-config-3.5 --includedir)
llvm.libs    := $(shell llvm-config-3.5 --libs) -lz -lcurses

prebuilt := llvm

# Binaries. Defined as
{'fraction_non_alphanumeric': 0.1277330264672037, 'fraction_numerical': 0.007671653241273495, 'mean_word_length': 4.267676767676767, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1228143', 'n_tokens_mistral': 1902, 'n_tokens_neox': 1887, 'n_words': 550}