What does your 2000-file package do? Presumably most
of it is not LAMMPS style files, but your own stuff.
So you can separate it into 2 parts. Small = the LAMMPS
style files. Big = everything else.
Build Big as a library, independent
of LAMMPS, in some dir of your own.
Then make a copy of the normal LAMMPS machine Makefile.foo
that you use and put it in src/MAKE/Mine with a new suffix,
e.g. Makefile.myfoo.
Now edit that file and add your lib and its location to the LIB and
LINKFLAGS variables at the top of the file. Which is the
same thing that is happening for any other lib files LAMMPS
is linking against (MPI, FFTW, libraries in the LAMMPS lib/* dirs).
Now put the Small files in the LAMMPS src dir and build
LAMMPS as “make myfoo”. This will compile your Small files and link to your lib
and create lmp_myfoo.
If you put your Small files in a src/PACKAGE-DIR
then you can make it work like packages in LAMMPS do,
but you don’t have to do that, if you prefer to just
do it manually in your own version of LAMMPS.
Steve