<commit_before># $Id$
# Copyright by the deal.II authors, 1998, 1999, 2000, 2001, 2002, 2010, 2011, 2012


ifneq ($(CLEAN),yes)

# deal.II top level directory
D=..


# get options which hold for all files of the project
include $D/common/Make.global_options

# top level targets
default all: debug optimized


# list the directories and the various kinds of files, the ones with the
# largest compile jobs first so that 'make -j N' saturates many processors
# also towards the end of compiling (e.g. numerics/vectors.cc takes several
# minutes to compile...)
all-dirs      := numerics fe dofs lac base grid hp multigrid distributed

cc-files      := $(shell for i in $(all-dirs) ; do echo $D/source/$$i/*.cc ; done)
h-files       := $(sort $(shell echo $D/include/deal.II/*/*.h))

# build unique object file names
tmp1     := $(shell echo $(cc-files) | $(PERL) -pi -e 's,$D/source/,,g; s,/,_,g;')
o-files  := $(addprefix $(LIBDIR)/optimized/, $(tmp1:.cc=.$(OBJEXT)) )
go-files := $(addprefix $(LIBDIR)/debug/, $(tmp1:.cc=.$(OBJEXT)))


debug: $(LIBDIR)/libdeal_II.g$(lib-suffix)
optimized: $(LIBDIR)/libdeal_II$(lib-suffix)



# rules how to generate object files from source files.
$(LIBDIR)/debug/%.$(OBJEXT) :
	@echo "======================debug======$(MT)== $(<:$D/source/%=%)"
	@$(CXX) $(CXXFLAGS.g) -c $< -o $@
$(LIBDIR)/optimized/%.$(OBJEXT) :
	@echo "======================optimized==$(MT)== $(<:$D/source/%=%)"
	@$(CXX) $(CXXFLAGS.o) -c $< -o $@



%.inst : %.inst.in $D/common/template-arguments
	@echo "======================instantiate==== $(@F)"
	@$D/common/scripts/expand_instantiations $D/common/template-arguments < $< > $@ || exit 1

%.inst : %.inst.pl $D/common/dealiitemplates.pm
	@echo "======================instantiate==== $(@F)"
	@perl -I $D/common/ $< > $@ || exit 1

#Todo: remove this target after renaming files
%.inst : %.pl $D/common/dealiitemplates.pm
	@echo "======================instantiate==== $(@F)"
	@perl -I $D/common/ $< > $@ || exit 1



# there are extra .o file for the function parser and umfpack that we
# need to link into out library
ifeq ($(enable-parser),yes)
  extra-o-files   := $(LIBDIR)/contrib/functionparser/fparser.$(OBJEXT)
  extra-g.o-files := $(LIBDIR)/contrib/functionparser/fparser.$(OBJEXT)
endif

ifeq ($(USE_CONTRIB_UMFPACK),yes)
  umfpack-files   := $(sort $(shell echo $(LIBDIR)/contrib/umfpack/*.$(OBJEXT)))
  extra-o-files   += $(umfpack-files)
  extra-g.o-files += $(umfpack-files)
endif



# in general, when linking shared libraries, we will want to link with
# the underlying libs as well. AIX even requires this. on the other
# hand, on DEC OSF with CXX this will fail with duplicate symbols, so
# make sure that it doesn't happen on that system and that compiler
ifneq ($(GXX-VERSION),compaq_cxx)
  # if we use HSL, then we need to link against libhsl.so.
  ifeq ($(USE_CONTRIB_HSL),yes)
    deplibs.g += $(lib-contrib-hsl)
    deplibs.o += $(lib-contrib-hsl)
  endif

  # same with PETSC
  ifeq ($(USE_CONTRIB_PETSC),yes)
    deplibs.g += $(lib-contrib-petsc.g) \
	         $(call DEAL_II_RPATH,$(DEAL_II_PETSC_LIBDIR))
    deplibs.o += $(lib-contrib-petsc.o) \
	         $(call DEAL_II_RPATH,$(DEAL_II_PETSC_LIBDIR))
  endif

  # same with SLEPC
  ifeq ($(USE_CONTRIB_SLEPC),yes)
    deplibs.g += $(lib-contrib-slepc) \
	         $(call DEAL_II_RPATH,$(DEAL_II_SLEPC_LIBDIR))
    deplibs.o += $(lib-contrib-slepc) \
	         $(call DEAL_II_RPATH,$(DEAL_II_SLEPC_LIBDIR))
  endif

  # same with TRILINOS
  ifeq ($(USE_CONTRIB_TRILINOS),yes)
    deplibs.g += $(lib-contrib-trilinos) \
	         $(call DEAL_II_RPATH,$(DEAL_II_TRILINOS_LIBDIR))
    deplibs.o += $(lib-contrib-trilinos) \
	         $(call DEAL_II_RPATH,$(DEAL_II_TRILINOS_LIBDIR))
  endif

  # same with MUMPS
  ifeq ($(USE_CONTRIB_MUMPS),yes)
    deplibs.g += $(lib-contrib-mumps)
    deplibs.o += $(lib-contrib-mumps)
  endif

  # and METIS
  ifeq ($(USE_CONTRIB_METIS),yes)
    deplibs.g += $(lib-contrib-metis)
    deplibs.o += $(lib-contrib-metis)
  endif

  # also link with TBB
  ifeq ($(enable-threads),yes)
    deplibs.g += $D/lib/libtbb_debug$(shared-lib-suffix)
    deplibs.o += $D/lib/libtbb$(shared-lib-suffix)
  endif

  # and p4est
  ifeq ($(USE_CONTRIB_P4EST),yes)
    deplibs.g += $(DEAL_II_P4EST_DIR)/DEBUG/$(DEAL_II_P4EST_LIBDIR_NAME)/libp4est$(shared-lib-suffix) \
                 $(DEAL_II_P4EST_DIR)/DEBUG/$(DEAL_II_P4EST_LIBDIR_NAME)/libsc$(shared-lib-suffix) \
		 $(call DEAL_II_RPATH,$(DEAL_II_P4EST_DIR)/DEBUG/$(DEAL_II_P4EST_LIBDIR_NAME))
    deplibs.o += $(DEAL_II_P4EST_DIR)/FAST/$(DEAL_II_P4EST_LIBDIR_NAME)/libp4est$(shared-lib-suffix) \
                 $(DEAL_II_P4EST_DIR)/FAST/$(DEAL_II_P4EST_LIBDIR_NAME)/libsc$(shared-lib-suffix) \
		 $(call DEAL_II_RPATH,$(DEAL_II_P4EST_DIR)/FAST/$(DEAL_II_P4EST_LIBDIR_NAME))
  endif

  # for cygwin and darwin, also llapack and such are necessary
  # we better link all libraries mentioned in $(LIBS)
  ifneq ($(findstring cygwin,$(TARGET))$(findstring darwin,$(TARGET)),)
    deplibs.g += $(LIBS)<commit_msg>Fix typo.<commit_after># $Id$
# Copyright by the deal.II authors, 1998, 1999, 2000, 2001, 2002, 2010, 2011, 2012


ifneq ($(CLEAN),yes)

# deal.II top level directory
D=..


# get options which hold for all files of the project
include $D/common/Make.global_options

# top level targets
default all: debug optimized


# list the directories and the various kinds of files, the ones with the
# largest compile jobs first so that 'make -j N' saturates many processors
# also towards the end of compiling (e.g. numerics/vectors.cc takes several
# minutes to compile...)
all-dirs      := numerics fe dofs lac base grid hp multigrid distributed

cc-files      := $(shell for i in $(all-dirs) ; do echo $D/source/$$i/*.cc ; done)
h-files       := $(sort $(shell echo $D/include/deal.II/*/*.h))

# build unique object file names
tmp1     := $(shell echo $(cc-files) | $(PERL) -pi -e 's,$D/source/,,g; s,/,_,g;')
o-files  := $(addprefix $(LIBDIR)/optimized/, $(tmp1:.cc=.$(OBJEXT)) )
go-files := $(addprefix $(LIBDIR)/debug/, $(tmp1:.cc=.$(OBJEXT)))


debug: $(LIBDIR)/libdeal_II.g$(lib-suffix)
optimized: $(LIBDIR)/libdeal_II$(lib-suffix)



# rules how to generate object files from source files.
$(LIBDIR)/debug/%.$(OBJEXT) :
	@echo "======================debug======$(MT)== $(<:$D/source/%=%)"
	@$(CXX) $(CXXFLAGS.g) -c $< -o $@
$(LIBDIR)/optimized/%.$(OBJEXT) :
	@echo "======================optimized==$(MT)== $(<:$D/source/%=%)"
	@$(CXX) $(CXXFLAGS.o) -c $< -o $@



%.inst : %.inst.in $D/common/template-arguments
	@echo "======================instantiate==== $(@F)"
	@$D/common/scripts/expand_instantiations $D/common/template-arguments < $< > $@ || exit 1

%.inst : %.inst.pl $D/common/dealiitemplates.pm
	@echo "======================instantiate==== $(@F)"
	@perl -I $D/common/ $< > $@ || exit 1

#Todo: remove this target after renaming files
%.inst : %.pl $D/common/dealiitemplates.pm
	@echo "======================instantiate==== $(@F)"
	@perl -I $D/common/ $< > $@ || exit 1



# there are extra .o file for the function parser and umfpack that we
# need to link into out library
ifeq ($(enable-parser),yes)
  extra-o-files   := $(LIBDIR)/contrib/functionparser/fparser.$(OBJEXT)
  extra-g.o-files := $(LIBDIR)/contrib/functionparser/fparser.$(OBJEXT)
endif

ifeq ($(USE_CONTRIB_UMFPACK),yes)
  umfpack-files   := $(sort $(shell echo $(LIBDIR)/contrib/umfpack/*.$(OBJEXT)))
  extra-o-files   += $(umfpack-files)
  extra-g.o-files += $(umfpack-files)
endif



# in general, when linking shared libraries, we will want to link with
# the underlying libs as well. AIX even requires this. on the other
# hand, on DEC OSF with CXX this will fail with duplicate symbols, so
# make sure that it doesn't happen on that system and that compiler
ifneq ($(GXX-VERSION),compaq_cxx)
  # if we use HSL, then we need to link against libhsl.so.
  ifeq ($(USE_CONTRIB_HSL),yes)
    deplibs.g += $(lib-contrib-hsl)
    deplibs.o += $(lib-contrib-hsl)
  endif

  # same with PETSC
  ifeq ($(USE_CONTRIB_PETSC),yes)
    deplibs.g += $(lib-contrib-petsc.g) \
	         $(call DEAL_II_RPATH,$(DEAL_II_PETSC_LIBDIR))
    deplibs.o += $(lib-contrib-petsc.o) \
	         $(call DEAL_II_RPATH,$(DEAL_II_PETSC_LIBDIR))
  endif

  # same with SLEPC
  ifeq ($(USE_CONTRIB_SLEPC),yes)
    deplibs.g += $(lib-contrib-slepc) \
	         $(call DEAL_II_RPATH,$(DEAL_II_SLEPC_LIBDIR))
    deplibs.o += $(lib-contrib-slepc) \
	         $(call DEAL_II_RPATH,$(DEAL_II_SLEPC_LIBDIR))
  endif

  # same with TRILINOS
  ifeq ($(USE_CONTRIB_TRILINOS),yes)
    deplibs.g += $(lib-contrib-trilinos) \
	         $(call DEAL_II_RPATH,$(DEAL_II_TRILINOS_LIBDIR))
    deplibs.o += $(lib-contrib-trilinos) \
	         $(call DEAL_II_RPATH,$(DEAL_II_TRILINOS_LIBDIR))
  endif

  # same with MUMPS
  ifeq ($(USE_CONTRIB_MUMPS),yes)
    deplibs.g += $(lib-contrib-mumps)
    deplibs.o += $(lib-contrib-mumps)
  endif

  # and METIS
  ifeq ($(USE_CONTRIB_METIS),yes)
    deplibs.g += $(lib-contrib-metis)
    deplibs.o += $(lib-contrib-metis)
  endif

  # also link with TBB
  ifeq ($(enable-threads),yes)
    deplibs.g += $D/lib/libtbb_debug$(shared-lib-suffix)
    deplibs.o += $D/lib/libtbb$(shared-lib-suffix)
  endif

  # and p4est
  ifeq ($(USE_CONTRIB_P4EST),yes)
    deplibs.g += $(DEAL_II_P4EST_DIR)/DEBUG/$(DEAL_II_P4EST_LIBDIR_NAME)/libp4est$(shared-lib-suffix) \
                 $(DEAL_II_P4EST_DIR)/DEBUG/$(DEAL_II_P4EST_LIBDIR_NAME)/libsc$(shared-lib-suffix) \
		 $(call DEAL_II_RPATH,$(DEAL_II_P4EST_DIR)/DEBUG/$(DEAL_II_P4EST_LIBDIR_NAME))
    deplibs.o += $(DEAL_II_P4EST_DIR)/FAST/$(DEAL_II_P4EST_LIBDIR_NAME)/libp4est$(shared-lib-suffix) \
                 $(DEAL_II_P4EST_DIR)/FAST/$(DEAL_II_P4EST_LIBDIR_NAME)/libsc$(shared-lib-suffix) \
		 $(call DEAL_II_RPATH,$(DEAL_II_P4EST_DIR)/FAST/$(DEAL_II_P4EST_LIBDIR_NAME))
  endif

  # for cygwin and darwin, also lapack and such are necessary
  # we better link all libraries mentioned in $(LIBS)
  ifneq ($(findstring cygwin,$(TARGET))$(findstring darwin,$(TARGET)),)
    deplibs.g += $(LIBS)
{'fraction_non_alphanumeric': 0.18836537503735432, 'fraction_numerical': 0.01075804362984361, 'mean_word_length': 3.919157275845174, 'pattern_counts': {'":': 0, '<': 19, '<?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': '1743511', 'n_tokens_mistral': 4114, 'n_tokens_neox': 3758, 'n_words': 824}