-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmakefile_collect
147 lines (109 loc) · 3.6 KB
/
makefile_collect
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# This file is part of Extractor_Markup.
# Extractor_Markup is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# Extractor_Markup is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with Extractor_Markup. If not, see <http://www.gnu.org/licenses/>.
# see link below for make file dependency magic
#
# http://bruno.defraine.net/techtips/makefile-auto-dependencies-with-gcc/
#
MAKE=gmake
BOOSTDIR := /extra/boost/boost-1.85_gcc-14
GCCDIR := /extra/gcc/gcc-14
GTESTDIR := /usr/local/include
UTILITYDIR := ${HOME}/projects/PF_Project/common_utilities
CPP := $(GCCDIR)/bin/g++
GCC := $(GCCDIR)/bin/gcc
# If no configuration is specified, "Debug" will be used
ifndef "CFG"
CFG := Debug
endif
# common definitions
OUTFILE := PF_CollectData
CFG_INC := -I${HOME}/projects/PF_Project/point_figure/src \
-I$(GTESTDIR) \
-I$(BOOSTDIR) \
-I/usr/local/include/ChartDirector \
-I$(UTILITYDIR)/include # \
RPATH_LIB := -Wl,-rpath,$(GCCDIR)/lib64 -Wl,-rpath,$(BOOSTDIR)/lib -Wl,-rpath,/usr/local/lib -Wl,-rpath,/usr/local/lib/ChartDirector
SDIR1 := .
SRCS1 := $(SDIR1)/Main.cpp
SDIR2 := ./src
SRCS2 := $(SDIR2)/PF_CollectDataApp.cpp \
$(SDIR2)/ConstructChartGraphic.cpp \
$(SDIR2)/Tiingo.cpp \
$(SDIR2)/Eodhd.cpp \
$(SDIR2)/Streamer.cpp
SRCS := $(SRCS1) $(SRCS2)
VPATH := $(SDIR1):$(SDIR2)
CFG_LIB := -L../lib_PF_Chart \
-lPF_Chart \
-L/usr/local/lib \
-ldate-tz \
-lfmt \
-lspdlog \
-lpqxx \
-lpq \
-L/usr/local/lib/ChartDirector \
-lchartdir \
-L$(GCCDIR)/lib64 \
-lstdc++ \
-lstdc++exp \
-L/usr/lib \
-lmpdec++ \
-lmpdec \
-lcrypt \
-lpthread \
-lssl -lcrypto \
-ljsoncpp \
-L$(BOOSTDIR)/lib \
-lboost_program_options-mt-x64
OBJS1=$(addprefix $(OUTDIR)/, $(addsuffix .o, $(basename $(notdir $(SRCS1)))))
OBJS2=$(addprefix $(OUTDIR)/, $(addsuffix .o, $(basename $(notdir $(SRCS2)))))
OBJS=$(OBJS1) $(OBJS2)
DEPS=$(OBJS:.o=.d)
#
# Configuration: Debug
#
ifeq "$(CFG)" "Debug"
OUTDIR=Debug_collect
COMPILE=$(CPP) -c -x c++ -O0 -g3 -std=c++23 -D_DEBUG -DBOOST_ENABLE_ASSERT_HANDLER -DSPDLOG_USE_STD_FORMAT -DUSE_OS_TZDB -fPIC -o $@ $(CFG_INC) $< -march=native -mtune=native -MMD -MP
CCOMPILE=$(GCC) -c -O0 -g3 -D_DEBUG -fPIC -o $@ $(CFG_INC) $< -march=native -mtune=native -MMD -MP
LINK := $(CPP) -g -o $(OUTFILE) $(OBJS) $(CFG_LIB) -Wl,-E $(RPATH_LIB)
endif # DEBUG configuration
#
# Configuration: Release
#
ifeq "$(CFG)" "Release"
OUTDIR=Release
COMPILE=$(CPP) -c -x c++ -O3 -std=c++23 -flto -DBOOST_ENABLE_ASSERT_HANDLER -DSPDLOG_USE_STD_FORMAT -DUSE_OS_TZDB -fPIC -o $@ $(CFG_INC) $< -march=native -mtune=native -MMD -MP
CCOMPILE=$(GCC) -c -O3 -flto -fPIC -o $@ $(CFG_INC) $< -march=native -mtune=native -MMD -MP
LINK := $(CPP) -flto=auto -o $(OUTFILE) $(OBJS) $(CFG_LIB) -Wl,-E $(RPATH_LIB)
endif # RELEASE configuration
# Build rules
all: $(OUTFILE)
$(OUTDIR)/%.o : %.cpp
$(COMPILE)
$(OUTDIR)/%.o : %.c
$(CCOMPILE)
$(OUTFILE): $(OUTDIR) $(OBJS1) $(OBJS2) $(OBJS4) ../lib_PF_Chart/libPF_Chart.a
$(LINK)
-include $(DEPS)
$(OUTDIR):
mkdir -p "$(OUTDIR)"
# Rebuild this project
rebuild: cleanall all
# Clean this project
clean:
rm -f $(OUTFILE)
rm -f $(OBJS)
rm -f $(OUTDIR)/*.d
rm -f $(OUTDIR)/*.o
# Clean this project and all dependencies
cleanall: clean