use a more conventional way to generate and include the lmpinstalledpkgs.h file
This commit is contained in:
@ -153,10 +153,13 @@ help:
|
||||
|
||||
lmpinstalledpkgs.h: $(SRC) $(INC)
|
||||
@echo 'Gathering installed package information (may take a little while)'
|
||||
@echo 'const char * LAMMPS_NS::LAMMPS::installed_packages[] = {' > lmpinstalledpkgs.tmp
|
||||
@echo '#ifndef LMP_INSTALLED_PKGS' > lmpinstalledpkgs.tmp
|
||||
@echo '#define LMP_INSTALLED_PKGS' >> lmpinstalledpkgs.tmp
|
||||
@echo 'const char * LAMMPS_NS::LAMMPS::installed_packages[] = {' >> lmpinstalledpkgs.tmp
|
||||
@for p in $(PACKAGEUC) $(PACKUSERUC); do info=$$($(SHELL) Package.sh $$p installed); \
|
||||
[ -n "$$info" ] && echo "\"$$info\"" | sed -e 's/".*package \(.*\)"/"\1",/' >> lmpinstalledpkgs.tmp || :; done
|
||||
@echo ' NULL };' >> lmpinstalledpkgs.tmp
|
||||
@echo '#endif' >> lmpinstalledpkgs.tmp
|
||||
@if [ -f lmpinstalledpkgs.h ]; \
|
||||
then test "`diff --brief lmpinstalledpkgs.tmp lmpinstalledpkgs.h`" != "" && \
|
||||
mv lmpinstalledpkgs.tmp lmpinstalledpkgs.h || rm lmpinstalledpkgs.tmp ; \
|
||||
|
||||
@ -51,6 +51,8 @@
|
||||
#include "version.h"
|
||||
#include "error.h"
|
||||
|
||||
#include "lmpinstalledpkgs.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
static void print_style(FILE *fp, const char *str, int &pos);
|
||||
@ -978,8 +980,6 @@ void print_style(FILE *fp, const char *str, int &pos)
|
||||
}
|
||||
}
|
||||
|
||||
#include "lmpinstalledpkgs.h"
|
||||
|
||||
void LAMMPS::print_config(FILE *fp)
|
||||
{
|
||||
const char *pkg;
|
||||
|
||||
Reference in New Issue
Block a user