-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (31 loc) · 985 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
30
31
32
33
34
35
36
37
#Compiling parameters
PDF_VIEWER=okular
FLAGS = -Wall -fsanitize=address -fsanitize=leak -std=c++17 -lgsl -lgslcblas -lm
SOURCES = $(shell find . -type f -name "*.cpp" | sed -e 's/\.cpp//g' -e 's/\.\///g')
BCyan=\033[1;36m
NC=\033[0m
.PHONY: graph
.PRECIOUS: %.x
all:
@echo -e "${BCyan}PROGRAMAS:${NC}"
@echo $(SOURCES) | tr " " "\n"
@echo -e "${BCyan}GRAPH:${NC}"
@echo "make graph gp=gnuplot_script corre el script gp.gp y abre el PDF resultado gp.pdf con PDF_VIEWER (okular)"
@echo -e "${BCyan}CLEAN:${NC}"
@echo "make clean borra los .x y .dat en todas las subcarpetas"
%: %.cpp
@echo 'Compiling [email protected]'
@g++ $(FLAGS) $< -o [email protected]
@echo -e 'Running [email protected]'
@./[email protected] > data/[email protected]
@echo 'Data stored in data/[email protected]'
%.x: %.cpp
@g++ $(FLAGS) $< -o $@
graph: $(gp)
@gnuplot $(gp).gp
@okular data/$(gp).pdf &
clean:
@find . -type f -name "*.x" -delete
@find . -type f -name "*.dat" -delete
@find . -type f -name "*.log" -delete
@find . -type f -name "*.csv" -delete