Import Geant4 3.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:55:53 +02:00
parent e7d7193284
commit cfcb558cfe
3050 changed files with 91703 additions and 48310 deletions
+52 -21
View File
@@ -1,4 +1,4 @@
# $Id: common.gmk,v 1.14 1999/12/05 22:41:38 morita Exp $
# $Id: common.gmk,v 1.24 2000/12/13 08:31:31 gcosmo Exp $
# ----------------------------------------------------------------
# Common part of GNUmakefile for libraries. John Allison, 5/7/95.
# ----------------------------------------------------------------
@@ -42,25 +42,35 @@ ifdef G4ODBMS
objects += $(patsubst include/%.ddl,$(G4TMPDIR)/%_ddl.o,$(schema_ddl))
endif
ifneq ($(G4MAKESHLIB),)
# Make shared library.
$(G4LIBDIR)/lib$(name).$(SHEXT): $(G4LIBDIR)/lib$(name).a
ifneq ($(G4TMPDIR),$(G4LIBDIR))
@cp $(G4TMPDIR)/*.o $(G4LIBDIR)/.
@sh $(G4MAKESHLIB) $(G4LIBDIR) $(name)
@$(RM) $(G4LIBDIR)/*.o
else
@sh $(G4MAKESHLIB) $(G4LIBDIR) $(name)
g4libraries_to_build :=
ifneq ($(G4LIB_BUILD_SHARED),)
g4libraries_to_build += $(G4LIBDIR)/lib$(name).$(SHEXT)
endif
ifneq ($(G4LIB_BUILD_STATIC),)
g4libraries_to_build += $(G4LIBDIR)/lib$(name).a
endif
# Make library.
lib: $(g4libraries_to_build)
ifneq ($(G4LIB_BUILD_SHARED),)
# Make shared library.
$(G4LIBDIR)/lib$(name).$(SHEXT): $(G4TMPDIR)/obj.last
@if [ ! -d $(G4LIBDIR) ] ; then mkdir $(G4LIBDIR) ;fi
@echo Creating shared library $@
@$(RM) $@
# use architecture specific macro defined in sys/$(G4SYSTEM).gmk
$(build-granular-shared-lib)
endif
ifneq ($(G4LIB_BUILD_STATIC),)
# Make static (archive) library.
$(G4LIBDIR)/lib$(name).a: $(G4TMPDIR)/obj.last
@if [ ! -d $(G4LIBDIR) ] ; then mkdir $(G4LIBDIR) ;fi
@echo Creating/replacing object files in $(G4LIBDIR)/lib$(name).a
@rm -f $(G4LIBDIR)/lib$(name).a
@$(AR) $(OUT_LIB)$(G4LIBDIR)/lib$(name).a $(G4TMPDIR)/*.o
@if [ -f /usr/bin/ranlib -o -f /bin/ranlib ] ; then ranlib $(G4LIBDIR)/lib$(name).a ;fi
endif
# Touch the versioning file
$(G4TMPDIR)/obj.last: $(objects)
@@ -116,7 +126,7 @@ endif
endif
# Make the .d file(s) and include it(them).
# g++ -MM is good at this, except it forgets the subdirectory
# g++ -MM (or -M) is good at this, except it forgets the subdirectory
# (hence the use of $G4TMP/).
# define G4SKIP_DEPEND for simplicity
@@ -126,8 +136,16 @@ ifdef G4ODBMS
endif
endif
ifdef G4ODBMS
GPPFLAGS := "-MM"
else
GPPFLAGS := "-M"
endif
ifdef G4SKIP_DEPEND
$(G4TMPDIR)/%.d:
$(G4TMPDIR)/%.d: src/%.cc
@if [ ! -d $(G4TMP)/$(G4SYSTEM) ] ; then mkdir $(G4TMP)/$(G4SYSTEM) ;fi
@if [ ! -d $(G4TMPDIR) ] ; then mkdir $(G4TMPDIR) ;fi
@echo Skip dependency file creation for file $< ...
else
$(G4TMPDIR)/%.d: src/%.cc
@@ -135,16 +153,18 @@ $(G4TMPDIR)/%.d: src/%.cc
@if [ ! -d $(G4TMPDIR) ] ; then mkdir $(G4TMPDIR) ;fi
@echo Making dependency for file $< ...
@($(ECHO) $(G4TMPDIR)/\\c ; \
g++ -MM $(CPPFLAGS) $< ) | sed 's!$(G4TMPDIR)/$*.o!& $@!' >$@
g++ $(GPPFLAGS) $(CPPFLAGS) $< ) | sed 's!$(G4TMPDIR)/$*.o!& $@!' >$@
ifneq ($(dependencies),)
-include $(dependencies)
endif
endif
# .PHONY targets are executed regardless of time-stamp of any file of
# same name.
ifdef G4ODBMS_DEPEND
.PHONY: all obj lib clean clean_libs d_files install_schema
.PHONY: all obj lib clean clean_libs d_files install_schema includes
else
.PHONY: all obj lib clean clean_libs
.PHONY: all obj lib clean clean_libs includes
endif
obj: $(G4TMPDIR)/obj.last
@@ -162,16 +182,24 @@ install_schema:
echo " schema header file does not exist, so ignore the error message...")
endif
ifneq ($(G4MAKESHLIB),)
lib: $(G4LIBDIR)/lib$(name).$(SHEXT)
else
lib: $(G4LIBDIR)/lib$(name).a
endif
installed_includes:=$(foreach file,$(wildcard include/*),$(shell test -f $(file) && echo $(file)))
installed_includes:=$(patsubst include/%,$(G4INCLUDE)/%,$(installed_includes))
# NOTE: the double colon rule allows to add other rules for the same target
#
includes:: $(installed_includes)
# Static Pattern rules, see GNU make manual for details.
# target(s): target-pattern : dep-pattern
#
$(installed_includes): $(G4INCLUDE)/% : include/%
@cp -p $< $@
ifndef G4EXLIB
clean:
@echo Cleaning up ...
@rm -f $(G4LIBDIR)/lib$(name).a
@rm -f $(G4LIBDIR)/lib$(name).$(SHEXT)
@rm -f $(schema_hh) $(schema_ref_hh)
@rm -rf $(G4TMPDIR)
endif
@@ -180,4 +208,7 @@ clean_libs:
@if [ -f $(G4LIBDIR)/lib$(name).a ] ; then \
$(ECHO) Removing library lib$(name).a ... ; \
$(RM) -f $(G4LIBDIR)/lib$(name).a ; fi
@if [ -f $(G4LIBDIR)/lib$(name).$(SHEXT) ] ; then \
$(ECHO) Removing library lib$(name).$(SHEXT) ... ; \
$(RM) -f $(G4LIBDIR)/lib$(name).$(SHEXT) ; fi