use a more conventional way to generate and include the lmpinstalledpkgs.h file

This commit is contained in:
Axel Kohlmeyer
2018-06-22 06:58:31 -04:00
parent 80cca7c4c1
commit e25b6c81ee
2 changed files with 6 additions and 3 deletions

View File

@ -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 ; \

View File

@ -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;