-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
80 lines (65 loc) · 3.01 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# project name (generate executable with this name)
TARGET = cageMol.exe
PML_SCRIPT = pymol_script.pml
PYMOL = pymol
CFLAGS=-Wall -g
LDFLAGS=-lR -lm
INCPATH=-I/usr/share/R/include
INCDIR=-Iinclude
OBJDIR=obj
SRCDIR=src
BINDIR=bin
CC=gcc -fopenmp -O3
EXEC=clean dir $(BINDIR)/$(TARGET)
SRC:=$(wildcard $(SRCDIR)/*.c)
OBJ:=$(SRC:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
all: $(EXEC)
demo: all $(BINDIR)/$(TARGET)
./$(BINDIR)/$(TARGET) -i ./demos/substrates/YILLAG.xyz -s 5
# Target to run and vizualize
cage: all $(BINDIR)/$(TARGET)
./$(BINDIR)/$(TARGET) -i $(INPUT_FILE) $(OPTIONS)
BASE_NAME=$(shell basename $(INPUT_FILE) .xyz) && ./generate_pml.sh $${BASE_NAME}
PYM_NAME=$(shell basename $(INPUT_FILE) .xyz) && $(PYMOL) results/$${PYM_NAME}/$(PML_SCRIPT)
# Target to generate the .pml script
vizualize:
./generate_pml.sh ${BASE_NAME}
$(PYMOL) results/${BASE_NAME}/$(PML_SCRIPT)
# Target to open PyMOL with the generated script
open_pymol:
$(PYMOL) open_pymol.pml
$(BINDIR)/$(TARGET): $(OBJ)
$(CC) -o $@ $^ $(LDFLAGS)
$(OBJ) : $(OBJDIR)/%.o : $(SRCDIR)/%.c
$(CC) $(INCPATH) $(INCDIR) -o $@ -c $< $(CFLAGS)
dir:
mkdir $(OBJDIR)
mkdir $(BINDIR)
.PHONY: clean mrproper all
#Rule for testing the pathfinding algorithm, use : -DDEBUGAstar
pathfinding:
$(CC) $(INCPATH) $(INCDIR) -o test/initialization.o -c src/initialization.c $(CFLAGS)
$(CC) $(INCPATH) $(INCDIR) -o test/input.o -c src/input.c $(CFLAGS)
$(CC) $(INCPATH) $(INCDIR) -o test/output.o -c src/output.c $(CFLAGS)
$(CC) $(INCPATH) $(INCDIR) -o test/pathFinding.o -c src/pathFinding.c $(CFLAGS)
$(CC) $(INCPATH) $(INCDIR) -o test/structure.o -c src/structure.c $(CFLAGS)
$(CC) $(INCPATH) $(INCDIR) -o test/structureAsp.o -c src/structureAsp.c $(CFLAGS)
$(CC) $(INCPATH) $(INCDIR) -o test/structureGph.o -c src/structureGph.c $(CFLAGS)
$(CC) $(INCPATH) $(INCDIR) -o test/structureLst.o -c src/structureLst.c $(CFLAGS)
$(CC) $(INCPATH) $(INCDIR) -o test/structureMN.o -c src/structureMN.c $(CFLAGS)
$(CC) $(INCPATH) $(INCDIR) -o test/structureMol.o -c src/structureMol.c $(CFLAGS)
$(CC) $(INCPATH) $(INCDIR) -o test/structureNH.o -c src/structureNH.c $(CFLAGS)
$(CC) $(INCPATH) $(INCDIR) -o test/structurePT.o -c src/structurePT.c $(CFLAGS)
$(CC) $(INCPATH) $(INCDIR) -o test/structureShl.o -c src/structureShl.c $(CFLAGS)
$(CC) $(INCPATH) $(INCDIR) -o test/util.o -c src/util.c $(CFLAGS)
$(CC) $(INCPATH) $(INCDIR) -o test/voxelization.o -c src/voxelization.c $(CFLAGS)
$(CC) $(INCPATH) $(INCDIR) -o test/pathFindingTest.o -c test/pathFindingTest.c $(CFLAGS)
$(CC) -o test/pathFinding.exe test/initialization.o test/input.o test/output.o test/pathFinding.o test/structure.o test/structureAsp.o test/structureGph.o test/structureLst.o test/structureMN.o test/structureMol.o test/structureNH.o test/structurePT.o test/structureShl.o test/util.o test/voxelization.o test/pathFindingTest.o $(LDFLAGS)
./test/pathFinding.exe
rm test/*.o
clean:
rm -rf $(OBJDIR)
rm -rf $(BINDIR)
ls
mrproper: clean
rm -rf results