Makefile 613 Bytes
Newer Older
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
export TOP := $(dir $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
BUILD := build
export BUILDDIR = $(addprefix $(TOP),$(BUILD))
SUBDIRS := IOcodes Main malleability

.PHONY: subdirs $(SUBDIRS) build all
#
#
#
#
CC := gcc
MCC := mpicc
CFLAGS := -Wall
LIBFLAGS := -lm -lslurm -pthread
#
#
#
#

all: subdirs exec

exec: subdirs
	$(MCC) $(CFLAGS) -o test.out $(wildcard $(BUILDDIR)/*.o) $(LIBFLAGS)

subdirs: $(SUBDIRS)
$(SUBDIRS): | $(BUILD)
	$(MAKE) -C $@

# Orden de compilacion para las carpetas

# Carpeta en la que almacenar los compilados
$(BUILD):
	mkdir -p $(BUILD)

clean:
	-rm -rf $(BUILD)