-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (31 loc) · 922 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
# Makefile for fft project
# Compiler
CXX = g++
# Compiler flags
CXXFLAGS = -pthread -g -lm -fopenmp
src_dir = ./src
test_dir = ./test
script_dir = ./script
# Source files
SOURCES = $(src_dir)/fft.cpp $(src_dir)/main.cpp
# Object files
OBJECTS = $(SOURCES:.cpp=.o)
# Target executable
TARGET = fft_app
# Rule to build the executable
$(TARGET): $(OBJECTS) $(src_dir)/fft.h
$(CXX) $(CXXFLAGS) $^ -o $(src_dir)/$@
./$(src_dir)/$(TARGET)
# Rule to build object files
%.o: %.cpp $(src_dir)/fft.h
$(CXX) $(CXXFLAGS) -c $< -o $@
# $@表示目标
# Rule to clean the project
clean:
rm -f $(TARGET) $(OBJECTS)
complex_test:
$(CXX) $(CXXFLAGS) $(test_dir)/complex_test.cpp -o $(test_dir)/complex_test
generate_w: $(script_dir)/generate_w_table.cpp $(src_dir)/fft.o
$(CXX) -c $(script_dir)/generate_w_table.cpp -o generate_w_table.o
$(CXX) $(CXXFLAGS) $(src_dir)/fft.o generate_w_table.o -o generate_w
./generate_w