-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
64 lines (49 loc) · 981 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# garbo -- global arrays + dtree
#
# makefile
#
# 2018.06.01 kiran.pamnany Initial code
#
CC=mpicc
CRAY?=no
INTEL?=no
.SUFFIXES: .c .h .o .a
.PHONY: clean test
CFLAGS+=-Wall
CFLAGS+=-std=c11
CFLAGS+=-D_GNU_SOURCE
CFLAGS+=-fpic
CFLAGS+=-I./include
CFLAGS+=-I./src
ifeq ($(CRAY),yes)
CC=cc
#CFLAGS+=-craympich-mt
LDFLAGS+=-Wl,--whole-archive,-ldmapp,--no-whole-archive
LDFLAGS+=-Wl,-rpath=/global/u1/k/kpamnany/mpich2-intel/lib
endif
ifeq ($(INTEL),yes)
CC=mpiicc
CFLAGS+=-mt_mpi
endif
SRCS=src/garbo.c src/garray.c src/dtree.c src/log.c
OBJS=$(subst .c,.o, $(SRCS))
ifeq ($(DEBUG),yes)
CFLAGS+=-O0 -g
else
CFLAGS+=-O2
endif
ifeq ($(shell uname), Darwin)
TARGET=libgarbo.dylib
else
TARGET=libgarbo.so
endif
all: $(TARGET)
test: $(TARGET)
$(MAKE) -C test
$(TARGET): $(OBJS)
$(CC) $(CFLAGS) -shared -o $(TARGET) $(LDFLAGS) $(OBJS)
.c.o:
$(CC) $(CFLAGS) -c $< -o $@
clean:
$(MAKE) -C test clean
$(RM) -f $(TARGET) $(OBJS)