--- Makefile.orig 2021-05-25 22:46:17 UTC +++ Makefile @@ -130,7 +130,7 @@ cplx: cp flavor_cplx.mk flavor.mk $(MAKE) all -install: all +install: ifdef INSTDIR mkdir -p $(INSTDIR)/bin install bin/*.x $(INSTDIR)/bin/ @@ -143,11 +143,14 @@ ifdef INSTDIR mkdir -p $(INSTDIR)/include install library/*.mod $(INSTDIR)/include/ - mkdir -p $(INSTDIR)/share mkdir -p $(INSTDIR)/share/BerkeleyGW # install cannot work on a whole directory - cp -rf examples $(INSTDIR)/share/BerkeleyGW/ +ifdef INSTALL_EXAMPLES + mkdir -p $(INSTDIR)/share/examples/BerkeleyGW + cp -rf examples $(INSTDIR)/share/examples/BerkeleyGW + find $(INSTDIR)/share/examples/BerkeleyGW -type d -empty -delete cp -rf testsuite $(INSTDIR)/share/BerkeleyGW/ +endif else $(error Error: Please define installation prefix INSTDIR via 'make install INSTDIR='.) endif