-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (48 loc) · 1.15 KB
/
Copy pathMakefile
File metadata and controls
64 lines (48 loc) · 1.15 KB
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
SDIR=src
ODIR=obj
IDIR=include
BDIR=bin
DDIR=data
CC=gcc
CFLAGS=-pedantic -Wall -g -I$(IDIR)
CFLAGS+=-Xpreprocessor -O3
LDFLAGS=-lm
MKDIR_P=mkdir -p
SH=/bin/bash
UNAME_S=$(shell uname -s)
ifeq ($(UNAME_S),Darwin)
CFLAGS+=-DDARWIN
else
LDFLAGS+=-lbsd
endif
vpath %.c $(TDIR)
vpath %.c $(SDIR)
.PHONY: all clean install distclean test cleanOut
TARGET=createDir $(BDIR)/tutorial_digraphs $(BDIR)/tutorial_graphs $(BDIR)/digraphCriticalNodesBF
# Compile C files
$(ODIR)/%.o: %.c
$(CC) $(CFLAGS) -o $@ -c $<
# Create Directories
createDir:
${MKDIR_P} ${ODIR}
${MKDIR_P} ${BDIR}
# Toolkit files
all: $(TARGET)
$(BDIR)/tutorial_digraphs: $(ODIR)/tutorial_digraphs.o $(ODIR)/graph.o $(ODIR)/utility.o
$(CC) $(LDFLAGS) -o $@ $^
$(BDIR)/tutorial_graphs: $(ODIR)/tutorial_graphs.o $(ODIR)/graph.o $(ODIR)/utility.o
$(CC) $(LDFLAGS) -o $@ $^
$(BDIR)/digraphCriticalNodesBF: $(ODIR)/digraphCriticalNodesBF.o $(ODIR)/graph.o $(ODIR)/utility.o
$(CC) $(LDFLAGS) -o $@ $^
# Clean files
clean:
rm $(ODIR)/*
rm $(BDIR)/*
# Clean output
cleanOut:
rm $(DDIR)/*.DOT
rm $(DDIR)/*.EDGES
rm $(DDIR)/*.pdf
rm $(DDIR)/*.csv
rm $(DDIR)/*.json
rm $(DDIR)/*.avgSP