<commit_before># compiler and Linker
CC          := gcc

# the Target Binary Program
TARGET      := lzss

# the Directories, Source, Includes, Objects, Binary and Resources
SRCDIR      := src
TESTDIR     := test
INCDIR      := inc
BUILDDIR    := int
TEST_BUILDDIR    := int/test
TARGETDIR   := target
RESDIR      := res
SRCEXT      := c
DEPEXT      := d
OBJEXT      := o

# flags, Libraries and Includes
CFLAGS      := -g -std=c99 -Wall -Wpedantic -Werror
LIB         :=
INC         := -I$(INCDIR) -I/usr/local/include
TEST_INC    := -I$(INCDIR) -I/usr/local/include
INCDEP      := -I$(INCDIR)

#---------------------------------------------------------------------------------
# DO NOT EDIT BELOW THIS LINE
#---------------------------------------------------------------------------------
SOURCES      := $(shell find $(SRCDIR) -type f -name *.$(SRCEXT))
OBJECTS      := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.$(OBJEXT)))

TEST_SOURCES := $(shell find $(TESTDIR) -type f -name *.$(SRCEXT))
TEST_OBJECTS := $(patsubst $(TESTDIR)/%,$(TEST_BUILDDIR)/%,$(TEST_SOURCES:.$(SRCEXT)=.$(OBJEXT)))
TEST_OBJECTS += $(OBJECTS)

# default Make
all: $(TARGET)

# remake
remake: cleaner all

# make the Directories
directories:
	@mkdir -p $(TARGETDIR)
	@mkdir -p $(BUILDDIR)
	@mkdir -p $(TEST_BUILDDIR)

# clean only objects
clean:
	@$(RM) -rf $(BUILDDIR)

# full clean, Objects and Binaries
cleaner: clean
	@$(RM) -rf $(TARGETDIR)

# pull in dependency info for *existing* .o files
-include $(OBJECTS:.$(OBJEXT)=.$(DEPEXT))
-include $(TEST_OBJECTS:.$(OBJEXT)=.$(DEPEXT))

# link
$(TARGET): $(OBJECTS)
	$(CC) -o $(TARGETDIR)/$(TARGET) $^ $(LIB)

# builds and runs the unit tests
test: $(TEST_OBJECTS)
	$(CC) -o $(TARGETDIR)/utest $^ $(LIB)

# compile
$(BUILDDIR)/%.$(OBJEXT): $(SRCDIR)/%.$(SRCEXT)
	@mkdir -p $(dir $@)
	$(CC) $(CFLAGS) $(INC) -c -o $@ $<
	@$(CC) $(CFLAGS) $(INCDEP) -MM $(SRCDIR)/$*.$(SRCEXT) > $(BUILDDIR)/$*.$(DEPEXT)
	@cp -f $(BUILDDIR)/$*.$(DEPEXT) $(BUILDDIR)/$*.$(DEPEXT).tmp
	@sed -e 's|.*:|$(BUILDDIR)/$*.$(OBJEXT):|' < $(BUILDDIR)/$*.$(DEPEXT).tmp > $(BUILDDIR)/$*.$(DEPEXT)
	@sed -e 's/.*://' -e 's/\\$$//' < $(BUILDDIR)/$*.$(DEPEXT).tmp | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $(BUILDDIR)/$*.$(DEPEXT)
	@rm -f $(BUILDDIR)/$*.$(DEPEXT).tmp

# compile
$(TEST_BUILDDIR)/%.$(OBJEXT): $(TESTDIR)/%.$(SRCEXT)
	@mkdir -p $(dir $@)
	$(CC) $(CFLAGS) $(TEST_INC) -c -o $@ $<
	$(CC) $(CFLAGS) $(TEST_INC) -MM $(TESTDIR)/$*.$(SRCEXT) > $(TEST_BUILDDIR)/$*.$(DEPEXT)
	@cp -f $(TEST_BUILDDIR)/$*.$(DEPEXT) $(BUILDDIR)/$*.$(DEPEXT).tmp
	@sed -e 's|.*:|$(TEST_BUILDDIR)/$*.$(OBJEXT):|' < $(TEST_BUILDDIR)/$*.$(DEPEXT).tmp > $(TEST_BUILDDIR)/$*.$(DEPEXT)
	@sed -e 's/.*://' -e 's/\\$$//' < $(BUILDDIR)/$*.$(DEPEXT).tmp | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $(TEST_BUILDDIR)/$*.$(DEPEXT)
	@rm -f $(TEST_BUILDDIR)/$*.$(DEPEXT).tmp

# non-File Targets
.PHONY: all remake clean cleaner resources<commit_msg>Simplified makefile version<commit_after># compiler
CC          := gcc

# binary file name
TARGET      := lzss

# the Directories, Source, Includes, Objects, Binary and Resources
SRCDIR      := src
TESTDIR     := tests
INCDIR      := inc
BUILDDIR    := int
TARGETDIR   := target
SRCEXT      := c
OBJEXT      := o
DEFINES     :=

# flags, libraries and includes
CFLAGS      := -g -std=c99 -Wall -Wpedantic -Werror
LIB         :=
INC         := -I$(INCDIR) -I/usr/local/include
DEFINES     :=

#---------------------------------------------------------------------------------
# DO NOT EDIT BELOW THIS LINE
#---------------------------------------------------------------------------------

SOURCES     := $(shell find $(SRCDIR) -type f -name *.$(SRCEXT))
OBJECTS     := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.$(OBJEXT)))


# default: compiles the binary
$(TARGET): $(OBJECTS) | dirs
	@$(CC) $(CFLAGS) $(INC) $(DEFINES) -o $(TARGETDIR)/$(TARGET) $^ $(LIB)
	@echo "LD $@"

# builds and runs the unit tests
tests: $(TEST_OBJECTS) $(OBJECTS) | dirs
	$(CC) $(CFLAGS) $(INC) $(DEFINES) -o $(TARGETDIR)/tests $^ $(LIB)
	@echo "LD $@"
	./$(TARGETDIR)/tests

# clean objects and binaries
clean:
	@$(RM) -rf $(BUILDDIR) $(TARGETDIR)

# creates the directories
dirs:
	@mkdir -p $(TARGETDIR)
	@mkdir -p $(BUILDDIR)

# rule to build dependencies files
$(BUILDDIR)/%.d:
	@mkdir -p $(dir $@)
	@$(CC) $(CFLAGS) $(INC) $(DEFINES) -MM $(SRCDIR)/$*.$(SRCEXT) -MT $(BUILDDIR)/$*.$(OBJEXT) > $(BUILDDIR)/$*.d

# rule to build object files
$(BUILDDIR)/%.$(OBJEXT): $(SRCDIR)/%.$(SRCEXT) $(BUILDDIR)/%.d
	@echo "CC $<"
	@$(CC) $(CFLAGS) $(INC) $(DEFINES) -c -o $@ $<


.PHONY: clean dirs

# includes generated dependency files
-include $(OBJECTS:.$(OBJEXT)=.d)
{'fraction_non_alphanumeric': 0.2954981864732238, 'fraction_numerical': 0.0012801365478984424, 'mean_word_length': 2.628482972136223, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 12, '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': '2570076', 'n_tokens_mistral': 1802, 'n_tokens_neox': 1780, 'n_words': 415}