Unverified Commit 2fbf86a5 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

add support for creating packages_*.h files in conventional make

parent ce1040a1
Loading
Loading
Loading
Loading
+52 −22
Original line number Original line Diff line number Diff line
@@ -55,6 +55,34 @@ style () {
  fi
  fi
}
}


packages () {
  list=`grep -sl $1 */$2*.h`
  if (test -e packages_$3.tmp) then
    rm -f packages_$3.tmp
  fi
  for file in $list; do
    dir="\"`dirname $file`\""
    echo "#undef PACKAGE" >> packages_$3.tmp
    echo "#define PACKAGE $dir" >> packages_$3.tmp
    qfile="\"$file\""
    echo "#include $qfile" >> packages_$3.tmp
  done
  if (test ! -e packages_$3.tmp) then
    if (test ! -e packages_$3.h) then
      touch packages_$3.h
    elif (test "`cat packages_$3.h`" != "") then
      rm -f packages_$3.h
      touch packages_$3.h
    fi
  elif (test ! -e packages_$3.h) then
    mv packages_$3.tmp packages_$3.h
  elif (test "`diff --brief packages_$3.h packages_$3.tmp`" != "") then
    mv packages_$3.tmp packages_$3.h
  else
    rm -f packages_$3.tmp
  fi
}

# create individual style files
# create individual style files
# called by "make machine"
# called by "make machine"
# col 1 = string to search for
# col 1 = string to search for
@@ -63,28 +91,30 @@ style () {
# col 4 = file that includes the style file
# col 4 = file that includes the style file
# col 5 = optional 2nd file that includes the style file
# col 5 = optional 2nd file that includes the style file


if (test $1 = "style") then
cmd=$1


  style ANGLE_CLASS     angle_      angle      force
if (test $cmd = "style") || (test $cmd = "packages") then
  style ATOM_CLASS      atom_vec_   atom       atom      atom_vec_hybrid

  style BODY_CLASS      body_       body       atom_vec_body
  $cmd ANGLE_CLASS     angle_      angle      force
  style BOND_CLASS      bond_       bond       force
  $cmd ATOM_CLASS      atom_vec_   atom       atom      atom_vec_hybrid
  style COMMAND_CLASS   ""          command    input
  $cmd BODY_CLASS      body_       body       atom_vec_body
  style COMPUTE_CLASS   compute_    compute    modify
  $cmd BOND_CLASS      bond_       bond       force
  style DIHEDRAL_CLASS  dihedral_   dihedral   force
  $cmd COMMAND_CLASS   ""          command    input
  style DUMP_CLASS      dump_       dump       output    write_dump
  $cmd COMPUTE_CLASS   compute_    compute    modify
  style FIX_CLASS       fix_        fix        modify
  $cmd DIHEDRAL_CLASS  dihedral_   dihedral   force
  style IMPROPER_CLASS  improper_   improper   force
  $cmd DUMP_CLASS      dump_       dump       output    write_dump
  style INTEGRATE_CLASS ""          integrate  update
  $cmd FIX_CLASS       fix_        fix        modify
  style KSPACE_CLASS    ""          kspace     force
  $cmd IMPROPER_CLASS  improper_   improper   force
  style MINIMIZE_CLASS  min_        minimize   update
  $cmd INTEGRATE_CLASS ""          integrate  update
  style NBIN_CLASS      nbin_       nbin       neighbor
  $cmd KSPACE_CLASS    ""          kspace     force
  style NPAIR_CLASS     npair_      npair      neighbor
  $cmd MINIMIZE_CLASS  min_        minimize   update
  style NSTENCIL_CLASS  nstencil_   nstencil   neighbor
  $cmd NBIN_CLASS      nbin_       nbin       neighbor
  style NTOPO_CLASS     ntopo_      ntopo      neighbor
  $cmd NPAIR_CLASS     npair_      npair      neighbor
  style PAIR_CLASS      pair_       pair       force
  $cmd NSTENCIL_CLASS  nstencil_   nstencil   neighbor
  style READER_CLASS    reader_     reader     read_dump
  $cmd NTOPO_CLASS     ntopo_      ntopo      neighbor
  style REGION_CLASS    region_     region     domain
  $cmd PAIR_CLASS      pair_       pair       force
  $cmd READER_CLASS    reader_     reader     read_dump
  $cmd REGION_CLASS    region_     region     domain


# edit Makefile.lib, for creating non-shared lib
# edit Makefile.lib, for creating non-shared lib
# called by "make makelib"
# called by "make makelib"
+1 −0
Original line number Original line Diff line number Diff line
@@ -205,6 +205,7 @@ gitversion:
	  -f MAKE/MACHINES/Makefile.$@ -o -f MAKE/MINE/Makefile.$@
	  -f MAKE/MACHINES/Makefile.$@ -o -f MAKE/MINE/Makefile.$@
	@if [ ! -d $(objdir) ]; then mkdir $(objdir); fi
	@if [ ! -d $(objdir) ]; then mkdir $(objdir); fi
	@$(SHELL) Make.sh style
	@$(SHELL) Make.sh style
	@$(SHELL) Make.sh packages
	@$(MAKE) $(MFLAGS) lmpinstalledpkgs.h gitversion
	@$(MAKE) $(MFLAGS) lmpinstalledpkgs.h gitversion
	@echo 'Compiling LAMMPS for machine $@'
	@echo 'Compiling LAMMPS for machine $@'
	@if [ -f MAKE/MACHINES/Makefile.$@ ]; \
	@if [ -f MAKE/MACHINES/Makefile.$@ ]; \
+24 −0
Original line number Original line Diff line number Diff line
@@ -22,6 +22,30 @@ style_nbin.h
style_npair.h
style_npair.h
style_nstencil.h
style_nstencil.h
style_ntopo.h
style_ntopo.h
# auto-generated packages files
packages_angle.h
packages_atom.h
packages_body.h
packages_bond.h
packages_command.h
packages_compute.h
packages_dihedral.h
packages_dump.h
packages_fix.h
packages_improper.h
packages_integrate.h
packages_kspace.h
packages_minimize.h
packages_pair.h
packages_reader.h
packages_region.h
packages_neigh_bin.h
packages_neigh_pair.h
packages_neigh_stencil.h
packages_nbin.h
packages_npair.h
packages_nstencil.h
packages_ntopo.h
# other auto-generated files
# other auto-generated files
lmpinstalledpkgs.h
lmpinstalledpkgs.h
lmpgitversion.h
lmpgitversion.h