-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
40 lines (31 loc) · 860 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
# Makefile
# some syntax:
# $@ is the object being built
# $^ is its dependencies
CPP = icpc
CPPFLAGS = -O3 -mkl
LIBS = -lfftw3
LIBS =
# source directory
SRCDIR = src
# object directory
OBJDIR = obj
### name of the output executable ###
BIN = fft
### objects needed to compile $(BIN)
OBJ = $(OBJDIR)/fft.o $(OBJDIR)/output.o $(OBJDIR)/fftmanip.o
### directories with headers
INCDIR = -I./include -I$(MKLROOT)/include/fftw
# main executable: this is made by default so should go on top
$(BIN): $(OBJ)
$(CPP) $(CPPFLAGS) $(INCDIR) $(LIBS) -o $@ $^
$(OBJDIR)/fft.o: $(SRCDIR)/fft.cpp
$(CPP) $(CPPFLAGS) $(INCDIR) -o $@ -c $^
$(OBJDIR)/output.o: $(SRCDIR)/output.cpp
$(CPP) $(CPPFLAGS) $(INCDIR) -o $@ -c $^
$(OBJDIR)/fftmanip.o: $(SRCDIR)/fftmanip.cpp
$(CPP) $(CPPFLAGS) $(INCDIR) -o $@ -c $^
.PHONY: clean
clean:
rm -f $(OBJDIR)/*.o
rm -f $(BIN)