5ab1c29c
tangwang
first commit
|
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
|
# Build targets
USER_FLAGS = -Wno-unused-result -Wno-unused-but-set-variable -Wno-sign-compare -Wall
USER_LIBS =
# Compiler flags
CXX = g++ -std=c++11
CXXFLAGS = $(USER_FLAGS) -O3 -I ./include
LDFLAGS = -lpthread
# The names of the executables that will be built
target_swing = bin/swing
target_icf_simple = bin/icf_simple
target_swing_symmetric = bin/swing_symmetric
# Ensure the bin directory exists
BIN_DIR = bin
# Declare phony targets
.PHONY: all clean
# Build all targets
all: $(BIN_DIR) $(target_swing) $(target_icf_simple) $(target_swing_symmetric)
# Create bin directory if it doesn't exist
$(BIN_DIR):
mkdir -p $(BIN_DIR)
# Build target swing
$(target_swing): src/swing.cc utils/utils.cc include/*
$(CXX) $(LDFLAGS) -o $(target_swing) src/swing.cc utils/utils.cc $(CXXFLAGS)
# Build target swing_1st_order
$(target_icf_simple): src/icf_simple.cc utils/utils.cc include/*
$(CXX) $(LDFLAGS) -o $(target_icf_simple) src/icf_simple.cc utils/utils.cc $(CXXFLAGS)
# Build target swing_symmetric
$(target_swing_symmetric): src/swing_symmetric.cc utils/utils.cc include/*
$(CXX) $(LDFLAGS) -o $(target_swing_symmetric) src/swing_symmetric.cc utils/utils.cc $(CXXFLAGS)
# Clean build files
clean:
rm -f $(target_swing) $(target_icf_simple) $(target_swing_symmetric)
find . -name '*.o' -delete
|