Compilar programes a la carpeta p*/out
Change-Id: I8e33aa1ea123b0500af1336185d2c8460fefb153
diff --git a/quad10/fenomens/lab/.gitignore b/quad10/fenomens/lab/.gitignore
index 5761abc..cfbd694 100644
--- a/quad10/fenomens/lab/.gitignore
+++ b/quad10/fenomens/lab/.gitignore
@@ -1 +1,2 @@
+p*/out/
*.o
diff --git a/quad10/fenomens/lab/p1/.gitignore b/quad10/fenomens/lab/p1/.gitignore
deleted file mode 100644
index c43abb3..0000000
--- a/quad10/fenomens/lab/p1/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-# Output:
-P1-exercici-1
-P1-exercici-2
-P1-exercici-3
-configuration.*
diff --git a/quad10/fenomens/lab/p1/Makefile b/quad10/fenomens/lab/p1/Makefile
index 1f95dc8..b02418a 100644
--- a/quad10/fenomens/lab/p1/Makefile
+++ b/quad10/fenomens/lab/p1/Makefile
@@ -1,13 +1,17 @@
+.PHONY: all make_out_folder
+
all: P1-exercici-1.o P1-exercici-2.o P1-exercici-3.o
-P1-exercici-1.o: mt19937ar.o P1-exercici-1.f90
+make_out_folder:
+ mkdir -p out
+P1-exercici-1.o: make_out_folder mt19937ar.o P1-exercici-1.f90
gfortran -c P1-exercici-1.f90
- gfortran P1-exercici-1.o mt19937ar.o -o P1-exercici-1
-P1-exercici-2.o: mt19937ar.o writeconfig.o P1-exercici-2.f90
+ gfortran P1-exercici-1.o mt19937ar.o -o out/P1-exercici-1
+P1-exercici-2.o: make_out_folder mt19937ar.o writeconfig.o P1-exercici-2.f90
gfortran -c P1-exercici-2.f90
- gfortran P1-exercici-2.o writeconfig.o mt19937ar.o -o P1-exercici-2
-P1-exercici-3.o: mt19937ar.o writeconfig.o magne.o P1-exercici-3.f90
+ gfortran P1-exercici-2.o writeconfig.o mt19937ar.o -o out/P1-exercici-2
+P1-exercici-3.o: make_out_folder mt19937ar.o writeconfig.o magne.o P1-exercici-3.f90
gfortran -c P1-exercici-3.f90
- gfortran P1-exercici-3.o writeconfig.o mt19937ar.o magne.o -o P1-exercici-3
+ gfortran P1-exercici-3.o writeconfig.o mt19937ar.o magne.o -o out/P1-exercici-3
mt19937ar.o: mt19937ar.f
f77 -c mt19937ar.f
writeconfig.o: writeconfig.f90
@@ -16,4 +20,4 @@
gfortran -c magne.f90
clean:
- rm -f configuration.eps configuration.tex configuration.svg P1-exercici-1 P1-exercici-2 P1-exercici-3 *.o
+ rm -rf configuration.eps configuration.tex configuration.svg *.o out
diff --git a/quad10/fenomens/lab/p1/P1-plotconfig.gnu b/quad10/fenomens/lab/p1/P1-plotconfig.gnu
index f3cdee3..186a5d3 100755
--- a/quad10/fenomens/lab/p1/P1-plotconfig.gnu
+++ b/quad10/fenomens/lab/p1/P1-plotconfig.gnu
@@ -1,6 +1,6 @@
-#!/usr/bin/env gnuplot -c
-outputfile = 'configuration' # Nom de la imatge resultant (sense extensió)
-datafile = 'configuration.conf' # Nom del fitxer de dades que es vol usar
+#!/usr/bin/env -S gnuplot -c
+outputfile = 'out/configuration' # Nom de la imatge resultant (sense extensió)
+datafile = 'out/configuration.conf' # Nom del fitxer de dades que es vol usar
L=64
symbsize=0.6
diff --git a/quad10/fenomens/lab/p1/README.md b/quad10/fenomens/lab/p1/README.md
index ba62b21..152e475 100644
--- a/quad10/fenomens/lab/p1/README.md
+++ b/quad10/fenomens/lab/p1/README.md
@@ -10,4 +10,4 @@
- `P1-exercici-4.f`: genera nombres a l'atzar discrets.
## Instruccions per compilar
-Per compilar, executeu `make all`.
+Per compilar, executeu `make all`. Els executables es trobaran a la carpeta `out`.
diff --git a/quad10/fenomens/lab/p2/.gitignore b/quad10/fenomens/lab/p2/.gitignore
index b915657..e69de29 100644
--- a/quad10/fenomens/lab/p2/.gitignore
+++ b/quad10/fenomens/lab/p2/.gitignore
@@ -1,4 +0,0 @@
-# Output:
-e1
-mc1
-configuration.*
diff --git a/quad10/fenomens/lab/p2/Makefile b/quad10/fenomens/lab/p2/Makefile
index 1849ab9..e015968 100644
--- a/quad10/fenomens/lab/p2/Makefile
+++ b/quad10/fenomens/lab/p2/Makefile
@@ -1,10 +1,14 @@
+.PHONY: all make_out_folder
+
all: P2-exercici-1.o MC-1.o
-P2-exercici-1.o: mt19937ar.o writeconfig.o magne.o energ.o P2-exercici-1.f90
+make_out_folder:
+ mkdir -p out
+P2-exercici-1.o: make_out_folder mt19937ar.o writeconfig.o magne.o energ.o P2-exercici-1.f90
gfortran -c P2-exercici-1.f90
- gfortran P2-exercici-1.o writeconfig.o mt19937ar.o magne.o energ.o -o e1
-MC-1.o: mt19937ar.o writeconfig.o magne.o energ.o MC-1.f90
+ gfortran P2-exercici-1.o writeconfig.o mt19937ar.o magne.o energ.o -o out/e1
+MC-1.o: make_out_folder mt19937ar.o writeconfig.o magne.o energ.o MC-1.f90
gfortran -c MC-1.f90
- gfortran MC-1.o writeconfig.o mt19937ar.o magne.o energ.o -o mc1
+ gfortran MC-1.o writeconfig.o mt19937ar.o magne.o energ.o -o out/mc1
mt19937ar.o: mt19937ar.f
f77 -c mt19937ar.f
writeconfig.o: writeconfig.f90
@@ -15,4 +19,4 @@
gfortran -c energ.f90
clean:
- rm -f configuration.eps configuration.tex configuration.svg configuration.conf e1 mc1 *.o
+ rm -rf out *.o
diff --git a/quad10/fenomens/lab/p2/README.md b/quad10/fenomens/lab/p2/README.md
index 930312c..ca135ad 100644
--- a/quad10/fenomens/lab/p2/README.md
+++ b/quad10/fenomens/lab/p2/README.md
@@ -7,4 +7,4 @@
- `MC-1.f`: codi que simula el model d'Ising 2D amb l'algorisme de Metropolis començant per una matriu d'spins generada a l'atzar.
## Instruccions per compilar
-Per compilar, executeu `make all`.
+Per compilar, executeu `make all`. Els executables es trobaran a la carpeta `out`.