-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
29 lines (21 loc) · 989 Bytes
/
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
CC = gcc
CFLAGS = -O2 -Wall -lm -Wextra -Wpedantic -Werror
DIR_SRC = src
DIR_BUILD = build
DIR_BINs = bins
all: is2d graphs
is2d: main.o ising-2d.o
$(CC) $(CFLAGS) $(DIR_BUILD)/ising-2d.o $(DIR_BUILD)/main.o -o $(DIR_BINs)/is2d -lGL -lGLU -lglut
main.o: dirs
$(CC) $(CFLAGS) -c $(DIR_SRC)/main.c -o $(DIR_BUILD)/main.o
ising-2d.o: dirs
$(CC) $(CFLAGS) -c $(DIR_SRC)/ising-2d.c -o $(DIR_BUILD)/ising-2d.o
graphs: ising-2d.o
$(CC) $(CFLAGS) -I $(DIR_SRC) $(DIR_BUILD)/ising-2d.o graphs-analysis/chi-vs-T-graph.c -o $(DIR_BINs)/chi-vs-T -lpthread
$(CC) $(CFLAGS) -I $(DIR_SRC) $(DIR_BUILD)/ising-2d.o graphs-analysis/m-vs-T-graph.c -o $(DIR_BINs)/m-vs-T
$(CC) $(CFLAGS) -I $(DIR_SRC) $(DIR_BUILD)/ising-2d.o graphs-analysis/binder-cumulant.c -o $(DIR_BINs)/binder-cumulant
$(CC) $(CFLAGS) -I $(DIR_SRC) $(DIR_BUILD)/ising-2d.o graphs-analysis/binder-cumulant-2.c -o $(DIR_BINs)/binder-cumulant-2
dirs:
mkdir -p $(DIR_BUILD) $(DIR_BINs)
clean:
rm -rf $(DIR_BUILD) $(DIR_BINs)