-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
59 lines (46 loc) · 1.38 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
#This make file builds the sub folder make files
PROG = np_shape_lab
JOBSCR = iu_cluster_job_script.pbs
TEST = test.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)
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
@echo "Directory creation is over."
cluster-submit:
@echo "Installing jobscript into $(BIN) directory"
cp -f $(SCRIPT)/$(JOBSCR) $(BIN)
+$(MAKE) -C $(BIN) submit
cluster-test-submit:
@echo "Installing test jobscript into $(BIN) directory"
cp -f $(SCRIPT)/$(TEST) $(BIN)
+$(MAKE) -C $(BIN) test
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)/outfiles/*.off $(BIN)/outfiles/*.out
rm -f $(BIN)/*.log
rm -f $(BIN)/*.pbs
.PHONY: all clean