forked from softmaterialslab/np-electrostatics-lab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·65 lines (53 loc) · 1.83 KB
/
Makefile
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#This make file builds the sub folder make files
PROG = np_electrostatics_lab
JOBSCR = iu_cluster_job_script.pbs
TESTDiskSCR = test_disk.pbs
TESTSphereSCR = test_sphere.pbs
BIN = bin
BASE = src
SCRIPT = scripts
all:
@echo "Starting build of the $(BASE) directory";
ifeq ($(CCF),BigRed2)
+$(MAKE) -C $(BASE) cluster-install
else ifeq ($(CCF),nanoHUB)
+$(MAKE) -C $(BASE) install
else
+$(MAKE) -C $(BASE) local-install
endif
@echo "Ending the build of the $(BASE) directory";
@echo "installing the $(PROG) into $(BIN) directory"; cp -f $(BASE)/$(PROG) $(BIN)
local-install: all create-dirs
cluster-install: create-dirs
make CCF=BigRed2 all
nanoHUB-install: create-dirs
make CCF=nanoHUB all
create-dirs:
@echo "Checking and creating needed sub-directories in the $(BIN) directory"
if ! [ -d $(BIN) ]; then mkdir $(BIN); fi
if ! [ -d $(BIN)/outfiles ]; then mkdir $(BIN)/outfiles; fi
if ! [ -d $(BIN)/datafiles ]; then mkdir $(BIN)/datafiles; fi
if ! [ -d $(BIN)/verifiles ]; then mkdir $(BIN)/verifiles; fi
if ! [ -d $(BIN)/computedfiles ]; then mkdir $(BIN)/computedfiles; fi
@echo "Directory creation is over."
cluster-submit:
@echo "Installing jobscript into $(BIN) directory"
cp -f $(SCRIPT)/$(JOBSCR) $(BIN)
+$(MAKE) -C $(BIN) submit
cluster-test-disk-submit:
@echo "Installing test jobscript into $(BIN) directory"
cp -f $(SCRIPT)/$(TESTDiskSCR) $(BIN)
+$(MAKE) -C $(BIN) test_disk
cluster-test-sphere-submit:
@echo "Installing test jobscript into $(BIN) directory"
cp -f $(SCRIPT)/$(TESTSphereSCR) $(BIN)
+$(MAKE) -C $(BIN) test_sphere
clean:
rm -f $(BASE)/*.o
rm -f $(BASE)/$(PROG)
rm -f $(BIN)/$(PROG)
dataclean:
rm -f $(BIN)/outfiles/*.dat $(BIN)/outfiles/*.xyz $(BIN)/outfiles/*.lammpstrj $(BIN)/datafiles/*.dat $(BIN)/verifiles/*.dat $(BIN)/computedfiles/*.dat
rm -f $(BIN)/*.log
rm -f $(BIN)/*.pbs
.PHONY: all clean