aboutsummaryrefslogtreecommitdiff
path: root/science/berkeleygw/files/patch-Makefile
blob: d3fafad2f630adad725074cbfb8637323fae0f2f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--- 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