-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (47 loc) · 1.77 KB
/
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
65
####################################################################################
# user specific options #
####################################################################################
# c compiler
CC = gcc-9
# linux, win32, or darwin
PLATFORM = darwin
# path to the java include directory
JAVAINCL = /usr/local/java/latest/include
# path to the FFTW3 include directory
FFTWINCL = /usr/local/include
# path to the FFTW3 library directory
FFTWLIBDIR = /usr/local/lib
# FFTW3 library name
# usually 'fftw3' but the precompiled win32 binary may be 'fftw3-3'
FFTWLIBNM = fftw3
# shared library target
TARGET = libjfftw.dylib
# FFTW thread library name
# leave this blank if you compiled FFTW with '--with-combined-threads' or if you did
# not compile with openmp or threads at all
FFTWLIBTHREAD = fftw3_omp
####################################################################################
# probably no need to change things below this line #
####################################################################################
SRCS = $(wildcard src/c/*.c)
OBJS = $(SRCS:.c=.o)
CFLAGS = -O3 -fPIC -flto -march=native -Isrc/c/ -I"$(JAVAINCL)" -I"$(JAVAINCL)/$(PLATFORM)" -I"$(FFTWINCL)" -Wall -std=c11
LDFLAGS = -shared -l$(FFTWLIBNM) -L"$(FFTWLIBDIR)" -Wall
ifeq ($(FFTWLIBTHREAD),fftw3_omp)
CFLAGS += -fopenmp
LDFLAGS += -lfftw3_omp
endif
ifeq ($(FFTWLIBTHREAD),fftw3_threads)
LDFLAGS += -lfftw3_threads
endif
RM = rm -f
.PHONY: all
all: ${TARGET}
$(TARGET): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $^
$(SRCS:.c=.d):%.d:%.c
$(CC) $(CFLAGS) -MM $< > $@
include $(SRCS:.c=.d)
.PHONY: clean
clean:
-$(RM) ${TARGET} ${OBJS} $(SRCS:.c=.d)