<commit_before>#
# MOOSE
#
moose_SRC_DIRS := $(MOOSE_DIR)/src
moose_SRC_DIRS += $(MOOSE_DIR)/contrib/mtwist-1.1

moose_INC_DIRS := $(shell find $(MOOSE_DIR)/include -type d -not -path "*/.svn*")
moose_INC_DIRS += $(shell find $(MOOSE_DIR)/contrib/*/include -type d -not -path "*/.svn*")
moose_INCLUDE  := $(foreach i, $(moose_INC_DIRS), -I$(i))

libmesh_INCLUDE := $(moose_INCLUDE) $(libmesh_INCLUDE)

moose_LIB := $(MOOSE_DIR)/libmoose-$(METHOD)$(libext)
LIBS += $(moose_LIB)

# source files
moose_srcfiles    := $(shell find $(moose_SRC_DIRS) -name *.C)
moose_csrcfiles   := $(shell find $(moose_SRC_DIRS) -name *.c)
moose_fsrcfiles   := $(shell find $(moose_SRC_DIRS) -name *.f)
moose_f90srcfiles := $(shell find $(moose_SRC_DIRS) -name *.f90)
# object files
moose_objects	:= $(patsubst %.C, %.$(obj-suffix), $(moose_srcfiles))
moose_objects	+= $(patsubst %.c, %.$(obj-suffix), $(moose_csrcfiles))
moose_objects += $(patsubst %.f, %.$(obj-suffix), $(moose_fsrcfiles))
moose_objects += $(patsubst %.f90, %.$(obj-suffix), $(moose_f90srcfiles))

# revision header
revision_header = $(MOOSE_DIR)/include/base/HerdRevision.h

all:: herd_revision moose

herd_revision:
	$(shell $(MOOSE_DIR)/scripts/get_repo_revision.py $(MOOSE_DIR))

moose: $(moose_LIB) 

# build rule for MOOSE
ifeq ($(enable-shared),yes)
# Build dynamic library
$(moose_LIB): $(moose_objects)
	@echo "Linking "$@"..."
	@$(libmesh_CC) $(libmesh_CXXSHAREDFLAG) -o $@ $(moose_objects) $(libmesh_LDFLAGS)
else
# Build static library
ifeq ($(findstring darwin,$(hostos)),darwin)
$(moose_LIB): $(moose_objects)
	@echo "Linking "$@"..."
	@libtool -static -o $@ $(moose_objects)
else
$(moose_LIB): $(moose_objects)
	@echo "Linking "$@"..."
	@$(AR) rv $@ $(moose_objects)
endif
endif

# include MOOSE dep files
-include $(MOOSE_DIR)/src/*/*.d
-include $(MOOSE_DIR)/src/*/*/*.d

-include $(MOOSE_DIR)/contrib/mtwist-1.1/src/*.d

#
# exodiff
#
exodiff_DIR := $(MOOSE_DIR)/contrib/exodiff
exodiff_APP := $(exodiff_DIR)/exodiff
exodiff_srcfiles := $(shell find $(exodiff_DIR) -name *.C)
exodiff_objfiles := $(patsubst %.C, %.$(obj-suffix), $(exodiff_srcfiles))

all:: exodiff

exodiff: $(exodiff_APP)

$(exodiff_APP): $(exodiff_objfiles)
	@echo "Linking "$@"..."
	@$(libmesh_CXX) $(libmesh_CXXFLAGS) $(exodiff_objfiles) -o $@ $(libmesh_LIBS) $(libmesh_LDFLAGS)

-include $(exodiff_DIR)/*.d


#
# Maintenance
#
clean::
	@rm -fr $(moose_LIB)
	@find . \( -name "*~" -or -name "*.o" -or -name "*.d" -or -name "*.pyc" \) -exec rm '{}' \;
	@rm -fr *.mod

clobber::
	@rm -fr $(moose_LIB)
	@find . \( -name "*~" -or -name "*.o" -or -name "*.d" -or -name "*.pyc" \
                -or -name "*.gcda" -or -name "*.gcno" -or -name "*.gcov" \) -exec rm '{}' \;
	@rm -fr *.mod

cleanall::
	make -C $(MOOSE_DIR) clean<commit_msg>Only include dependencies for files that actually exist, not *.d (#000)<commit_after>#
# MOOSE
#
moose_SRC_DIRS := $(MOOSE_DIR)/src
moose_SRC_DIRS += $(MOOSE_DIR)/contrib/mtwist-1.1

moose_INC_DIRS := $(shell find $(MOOSE_DIR)/include -type d -not -path "*/.svn*")
moose_INC_DIRS += $(shell find $(MOOSE_DIR)/contrib/*/include -type d -not -path "*/.svn*")
moose_INCLUDE  := $(foreach i, $(moose_INC_DIRS), -I$(i))

libmesh_INCLUDE := $(moose_INCLUDE) $(libmesh_INCLUDE)

moose_LIB := $(MOOSE_DIR)/libmoose-$(METHOD)$(libext)
LIBS += $(moose_LIB)

# source files
moose_srcfiles    := $(shell find $(moose_SRC_DIRS) -name *.C)
moose_csrcfiles   := $(shell find $(moose_SRC_DIRS) -name *.c)
moose_fsrcfiles   := $(shell find $(moose_SRC_DIRS) -name *.f)
moose_f90srcfiles := $(shell find $(moose_SRC_DIRS) -name *.f90)
# object files
moose_objects	:= $(patsubst %.C, %.$(obj-suffix), $(moose_srcfiles))
moose_objects	+= $(patsubst %.c, %.$(obj-suffix), $(moose_csrcfiles))
moose_objects += $(patsubst %.f, %.$(obj-suffix), $(moose_fsrcfiles))
moose_objects += $(patsubst %.f90, %.$(obj-suffix), $(moose_f90srcfiles))
# dependency files
moose_deps := $(patsubst %.C, %.$(obj-suffix).d, $(moose_srcfiles)) \
              $(patsubst %.c, %.$(obj-suffix).d, $(moose_csrcfiles))

# revision header
revision_header = $(MOOSE_DIR)/include/base/HerdRevision.h

all:: herd_revision moose

herd_revision:
	$(shell $(MOOSE_DIR)/scripts/get_repo_revision.py $(MOOSE_DIR))

moose: $(moose_LIB) 

# build rule for MOOSE
ifeq ($(enable-shared),yes)
# Build dynamic library
$(moose_LIB): $(moose_objects)
	@echo "Linking "$@"..."
	@$(libmesh_CC) $(libmesh_CXXSHAREDFLAG) -o $@ $(moose_objects) $(libmesh_LDFLAGS)
else
# Build static library
ifeq ($(findstring darwin,$(hostos)),darwin)
$(moose_LIB): $(moose_objects)
	@echo "Linking "$@"..."
	@libtool -static -o $@ $(moose_objects)
else
$(moose_LIB): $(moose_objects)
	@echo "Linking "$@"..."
	@$(AR) rv $@ $(moose_objects)
endif
endif

# include MOOSE dep files
-include $(moose_deps)
-include $(MOOSE_DIR)/contrib/mtwist-1.1/src/*.d

#
# exodiff
#
exodiff_DIR := $(MOOSE_DIR)/contrib/exodiff
exodiff_APP := $(exodiff_DIR)/exodiff
exodiff_srcfiles := $(shell find $(exodiff_DIR) -name *.C)
exodiff_objfiles := $(patsubst %.C, %.$(obj-suffix), $(exodiff_srcfiles))

all:: exodiff

exodiff: $(exodiff_APP)

$(exodiff_APP): $(exodiff_objfiles)
	@echo "Linking "$@"..."
	@$(libmesh_CXX) $(libmesh_CXXFLAGS) $(exodiff_objfiles) -o $@ $(libmesh_LIBS) $(libmesh_LDFLAGS)

-include $(exodiff_DIR)/*.d


#
# Maintenance
#
clean::
	@rm -fr $(moose_LIB)
	@find . \( -name "*~" -or -name "*.o" -or -name "*.d" -or -name "*.pyc" \) -exec rm '{}' \;
	@rm -fr *.mod

clobber::
	@rm -fr $(moose_LIB)
	@find . \( -name "*~" -or -name "*.o" -or -name "*.d" -or -name "*.pyc" \
                -or -name "*.gcda" -or -name "*.gcno" -or -name "*.gcov" \) -exec rm '{}' \;
	@rm -fr *.mod

cleanall::
	make -C $(MOOSE_DIR) clean


echo:
	@echo $(moose_deps)
{'fraction_non_alphanumeric': 0.21484579194981704, 'fraction_numerical': 0.004704652378463147, 'mean_word_length': 4.54054054054054, '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': '5773646', 'n_tokens_mistral': 2520, 'n_tokens_neox': 2403, 'n_words': 495}