-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (28 loc) · 744 Bytes
/
Makefile
File metadata and controls
44 lines (28 loc) · 744 Bytes
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
# Copyright 2024 Bull SAS
PREFIX=./build
OPENMP_CFLAGS = -DHAVE_OPENMP -fopenmp
OPENMP_LDFLAGS = -liomp5 # requres intel compilers
MPI_FLAGS = -DHAVE_MPI
OPTFLAGS = -g -O2
CFLAGS = -std=c99 $(OPTFLAGS) -fPIC -Werror -Wall
CPPFLAGS = $(MPI_FLAGS) $(OPENMP_CFLAGS)
LDFLAGS = $(OPENMP_LDFLAGS)
DEBUG?=0
TRACE?=0
ifeq (${DEBUG},1)
CFLAGS += -D__DEBUG
endif
MPICC=mpicc
all: libmoc.so moc
install: all
install -D libmoc.so $(PREFIX)/lib/libmoc.so
install -D moc $(PREFIX)/bin/moc
install -D doc/doc.rst $(PREFIX)/doc/doc.rst
%.o: %.c
$(MPICC) ${CFLAGS} $(CPPFLAGS) -c $< -o $@
libmoc.so: moc.o
$(MPICC) -shared -fPIC $(LDFLAGS) $^ -o $@
moc: moc_command.c
$(CC) -W -Wall -Wextra -o $@ $<
clean:
$(RM) -f *.so moc *.o *~