forked from lanl/tycho2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (28 loc) · 788 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
38
39
40
41
# Settings for local environment
include make.inc
# Add assert level and PETSc flag to compile command
MPICC += -DASSERT_ON=$(ASSERT_ON) -DUSE_PETSC=$(USE_PETSC)
# Include source directory
INC += -Isrc
# Add PETSC include directory and library command
ifeq ($(USE_PETSC), 1)
INC += $(PETSC_INC)
LIBS += $(PETSC_LIB)
endif
# List of sources, header files, and object files
SOURCE = $(wildcard src/*.cc)
HEADERS = $(wildcard src/*.hh)
OBJECTS = $(patsubst src%.cc, build%.o, $(SOURCE))
# Link object files
sweep.x: $(OBJECTS)
@echo Linking $@
$(MPICC) $(OBJECTS) -o sweep.x ${LIBS}
# Make object files
build/%.o: src/%.cc $(HEADERS) make.inc
@echo Making $@
$(MPICC) $(INC) -c $< -o $@
# Delete object files
.PHONY: clean
clean:
@echo Delete object files
rm build/*.o