-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
438 lines (373 loc) · 14.6 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
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
SHELL := $(shell which bash)
OSS_ROOT ?= terark-downloads
DBG_FLAGS ?= -g3 -D_DEBUG
RLS_FLAGS ?= -O3 -DNDEBUG -g3
MARCH ?= $(shell uname -m)
ifeq "${MARCH}" "x86_64"
WITH_BMI2 ?= $(shell bash ./cpu_has_bmi2.sh)
else
# not available
WITH_BMI2 ?= na
endif
ROCKSDB_SRC ?= ../rocksdb
TERARK_CORE_HOME ?= ../terark
VCPKG_HOME ?= /node-shared/vcpkg
ifeq "$(origin LD)" "default"
LD := ${CXX}
endif
#COMPILER := $(shell ${CXX} --version | head -1 | awk '{split($$3, Ver, "."); printf("%s-%d.%d", $$1, Ver[1], Ver[2]);}')
# Makefile is stupid to parsing $(shell echo ')')
#COMPILER := $(shell ${CXX} --version | head -1 | sed 's/\(\S\+\)\s\+([^()]*)\s\+\([0-9]\+.[0-9]\+\).*/\1-\2/')
tmpfile := $(shell mktemp compiler-XXXXXX)
COMPILER := $(shell ${CXX} tools/configure/compiler.cpp -o ${tmpfile}.exe && ./${tmpfile}.exe && rm -f ${tmpfile}*)
#$(error COMPILER=${COMPILER})
UNAME_MachineSystem := $(shell uname -m -s | sed 's:[ /]:-:g')
TerarkLibDir ?= ${TERARK_CORE_HOME}/build/${UNAME_MachineSystem}-${COMPILER}-bmi2-${WITH_BMI2}/lib
BUILD_NAME := ${UNAME_MachineSystem}-${COMPILER}-bmi2-${WITH_BMI2}
BUILD_ROOT := build/${BUILD_NAME}
ddir:=${BUILD_ROOT}/dbg
rdir:=${BUILD_ROOT}/rls
gen_sh := $(dir $(lastword ${MAKEFILE_LIST}))gen_env_conf.sh
err := $(shell env bash ${gen_sh} "${CXX}" ${COMPILER} ${BUILD_ROOT}/env.mk; echo $$?)
ifneq "${err}" "0"
$(error err = ${err} MAKEFILE_LIST = ${MAKEFILE_LIST}, PWD = ${PWD}, gen_sh = ${gen_sh} "${CXX}" ${COMPILER} ${BUILD_ROOT}/env.mk)
endif
TERARK_INC := -I${TERARK_CORE_HOME}/src -I$(TERARK_CORE_HOME)/3rdparty/zstd ${BOOST_INC}
include ${BUILD_ROOT}/env.mk
UNAME_System := $(shell uname | sed 's/^\([0-9a-zA-Z]*\).*/\1/')
ifeq (CYGWIN, ${UNAME_System})
FPIC =
# lazy expansion
CYGWIN_LDFLAGS = -Wl,--out-implib=$@ \
-Wl,--export-all-symbols \
-Wl,--enable-auto-import
DLL_SUFFIX = .dll.a
CYG_DLL_FILE = $(shell echo $@ | sed 's:\(.*\)/lib\([^/]*\)\.a$$:\1/cyg\2:')
COMMON_C_FLAGS += -Wa,-mbig-obj
else
ifeq (Darwin,${UNAME_System})
DLL_SUFFIX = .dylib
else
DLL_SUFFIX = .so
endif
FPIC = -fPIC
CYG_DLL_FILE = $@
endif
override CFLAGS += ${FPIC}
override CXXFLAGS += ${FPIC}
override LDFLAGS += ${FPIC}
ifeq "$(shell a=${COMPILER};echo $${a:0:3})" "g++"
ifeq (Linux, ${UNAME_System})
override LDFLAGS += -rdynamic
endif
ifeq (${UNAME_System},Darwin)
COMMON_C_FLAGS += -Wa,-q
endif
override CXXFLAGS += -time
ifeq "$(shell echo ${COMPILER} | awk -F- '{if ($$2 >= 4.8) print 1;}')" "1"
CXX_STD := -std=gnu++17
endif
endif
ifeq "${CXX_STD}" ""
CXX_STD := -std=gnu++17
endif
# icc or icpc
ifeq "$(shell a=${COMPILER};echo $${a:0:2})" "ic"
override CXXFLAGS += -xHost -fasm-blocks
CPU ?= -xHost
else
CPU ?= -march=native
COMMON_C_FLAGS += -Wno-deprecated-declarations
ifeq "$(shell a=${COMPILER};echo $${a:0:5})" "clang"
COMMON_C_FLAGS += -fstrict-aliasing
else
COMMON_C_FLAGS += -Wstrict-aliasing=3
endif
endif
ifeq (${WITH_BMI2},1)
CPU += -mbmi -mbmi2
else
CPU += -mno-bmi -mno-bmi2
endif
COMMON_C_FLAGS += -Wformat=2 -Wcomment
COMMON_C_FLAGS += -Wall -Wextra
COMMON_C_FLAGS += -Wno-unused-parameter
COMMON_C_FLAGS += -D_GNU_SOURCE # For cygwin
COMMON_C_FLAGS += -DROCKSDB_SUPPORT_THREAD_LOCAL
#-v #-Wall -Wparentheses
#COMMON_C_FLAGS += ${COMMON_C_FLAGS} -Wpacked -Wpadded -v
#COMMON_C_FLAGS += ${COMMON_C_FLAGS} -Winvalid-pch
#COMMON_C_FLAGS += ${COMMON_C_FLAGS} -fmem-report
ifeq "$(shell a=${COMPILER};echo $${a:0:5})" "clang"
COMMON_C_FLAGS += -fcolor-diagnostics
endif
#CXXFLAGS +=
#CXXFLAGS += -fpermissive
#CXXFLAGS += -fexceptions
#CXXFLAGS += -fdump-translation-unit -fdump-class-hierarchy
override CFLAGS += ${COMMON_C_FLAGS}
override CXXFLAGS += ${COMMON_C_FLAGS}
#$(error ${CXXFLAGS} "----" ${COMMON_C_FLAGS})
# DEFS := -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
DEFS += -DROCKSDB_PLATFORM_POSIX
ifeq (Darwin,${UNAME_System})
DEFS += -DOS_MACOSX
endif
override CFLAGS += ${DEFS}
override CXXFLAGS += ${DEFS}
override INCS := ${TERARK_INC} ${INCS}
override INCS += -I${ROCKSDB_SRC} -I${ROCKSDB_SRC}/include
#LIBS += -ldl
#LIBS += -lpthread
#extf = -pie
extf = -fno-stack-protector
#extf+=-fno-stack-protector-all
override CFLAGS += ${extf}
#override CFLAGS += -g3
override CXXFLAGS += ${extf}
#override CXXFLAGS += -g3
#CXXFLAGS += -fnothrow-opt
override INCS += -I/opt/include
override LIBS += -L/opt/lib -Wl,-Bstatic -Wl,-Bdynamic
ifeq (, ${prefix})
ifeq (root, ${USER})
prefix := /usr
else
prefix := /home/${USER}
endif
endif
ToplingDcompact_lib := topling-dcompact
ToplingDcompact_src := $(wildcard src/table/*.cc)
ToplingDcompact_src += ${BUILD_ROOT}/git-version-topling_dcompact.cc
TerarkTests_src += $(wildcard src/table/tests/*.cc)
LIB_TERARK_D := -L${TerarkLibDir} -lterark-zbs-${COMPILER}-d -lterark-fsa-${COMPILER}-d -lterark-core-${COMPILER}-d
LIB_TERARK_R := -L${TerarkLibDir} -lterark-zbs-${COMPILER}-r -lterark-fsa-${COMPILER}-r -lterark-core-${COMPILER}-r
#function definition
#@param:${1} -- targets var prefix, such as bdb_util | core
#@param:${2} -- build type: d | r
objs = $(addprefix ${${2}dir}/, $(addsuffix .o, $(basename ${${1}_src})))
ToplingDcompact_d_o := $(call objs,ToplingDcompact,d)
ToplingDcompact_r_o := $(call objs,ToplingDcompact,r)
ToplingDcompact_d := ${BUILD_ROOT}/lib/lib${ToplingDcompact_lib}-${COMPILER}-d${DLL_SUFFIX}
ToplingDcompact_r := ${BUILD_ROOT}/lib/lib${ToplingDcompact_lib}-${COMPILER}-r${DLL_SUFFIX}
static_ToplingDcompact_d := ${BUILD_ROOT}/lib/lib${ToplingDcompact_lib}-${COMPILER}-d.a
static_ToplingDcompact_r := ${BUILD_ROOT}/lib/lib${ToplingDcompact_lib}-${COMPILER}-r.a
ALL_TARGETS = ToplingDcompact
DBG_TARGETS = ${ToplingDcompact_d}
RLS_TARGETS = ${ToplingDcompact_r}
.PHONY : default all ToplingDcompact
default : ToplingDcompact
all : ${ALL_TARGETS}
ToplingDcompact: ${ToplingDcompact_d} \
${ToplingDcompact_r} \
${static_ToplingDcompact_d} \
${static_ToplingDcompact_r}
allsrc = ${ToplingDcompact_src}
alldep = $(addprefix ${rdir}/, $(addsuffix .dep, $(basename ${allsrc}))) \
$(addprefix ${ddir}/, $(addsuffix .dep, $(basename ${allsrc})))
.PHONY : dbg rls
dbg: ${DBG_TARGETS}
rls: ${RLS_TARGETS}
ifneq (${UNAME_System},Darwin)
${ToplingDcompact_d} ${ToplingDcompact_r} : LIBS += -lrt
endif
#${ToplingDcompact_d} : override LIBS := ${LIB_TERARK_D} ${LIBS} -ltbb_debug
${ToplingDcompact_d} : override LIBS := ${LIB_TERARK_D} ${LIBS} #-ltbb
${ToplingDcompact_r} : override LIBS := ${LIB_TERARK_R} ${LIBS} #-ltbb
${ToplingDcompact_d} ${ToplingDcompact_r} : LIBS += -lpthread
${ToplingDcompact_d} : $(call objs,ToplingDcompact,d)
${ToplingDcompact_r} : $(call objs,ToplingDcompact,r)
${static_ToplingDcompact_d} : $(call objs,ToplingDcompact,d)
${static_ToplingDcompact_r} : $(call objs,ToplingDcompact,r)
TarBallBaseName := ${ToplingDcompact_lib}-${BUILD_NAME}
TarBall := pkg/${ToplingDcompact_lib}-${BUILD_NAME}
.PHONY : pkg
.PHONY : tgz
pkg : ${TarBall}
tgz : ${TarBall}.tgz
${TarBall}: ${ToplingDcompact_d} ${static_ToplingDcompact_d} \
${ToplingDcompact_r} ${static_ToplingDcompact_r} \
$(wildcard ${TerarkLibDir}/libterark-*)
rm -rf ${TarBall}
mkdir -p ${TarBall}/lib
mkdir -p ${TarBall}/bin
mkdir -p ${TarBall}/include/table
ifeq (${PKG_WITH_DBG},1)
cp -a ${BUILD_ROOT}/lib/lib${ToplingDcompact_lib}-{${COMPILER}-,}d${DLL_SUFFIX} ${TarBall}/lib
cp -a ${TerarkLibDir}/libterark-zbs-{${COMPILER}-,}d${DLL_SUFFIX} ${TarBall}/lib
cp -a ${TerarkLibDir}/libterark-fsa-{${COMPILER}-,}d${DLL_SUFFIX} ${TarBall}/lib
cp -a ${TerarkLibDir}/libterark-core-{${COMPILER}-,}d${DLL_SUFFIX} ${TarBall}/lib
ifeq (${PKG_WITH_STATIC},1)
mkdir -p ${TarBall}/lib_static
cp -a ${BUILD_ROOT}/lib/lib${ToplingDcompact_lib}-{${COMPILER}-,}d.a ${TarBall}/lib_static
cp -a ${TerarkLibDir}/libterark-zbs-{${COMPILER}-,}d.a ${TarBall}/lib_static
cp -a ${TerarkLibDir}/libterark-fsa-{${COMPILER}-,}d.a ${TarBall}/lib_static
cp -a ${TerarkLibDir}/libterark-core-{${COMPILER}-,}d.a ${TarBall}/lib_static
endif
endif
ifeq (${PKG_WITH_STATIC},1)
mkdir -p ${TarBall}/lib_static
cp -a ${BUILD_ROOT}/lib/lib${ToplingDcompact_lib}-{${COMPILER}-,}r.a ${TarBall}/lib_static
cp -a ${TerarkLibDir}/libterark-zbs-{${COMPILER}-,}r.a ${TarBall}/lib_static
cp -a ${TerarkLibDir}/libterark-fsa-{${COMPILER}-,}r.a ${TarBall}/lib_static
cp -a ${TerarkLibDir}/libterark-core-{${COMPILER}-,}r.a ${TarBall}/lib_static
endif
ifeq (${PKG_WITH_ROCKSDB},1)
for header_dir in `find "../rocksdb/include" -type d`; do \
install -d ${TarBall}/"$${header_dir#../rocksdb/}"; \
done; \
for header in `find "../rocksdb/include" -type f -name '*.h'`; do \
install -C -m 644 $$header ${TarBall}/"$${header#../rocksdb/}"; \
done
ifeq (${PKG_WITH_STATIC},1)
cp -a ../rocksdb/${UNAME_MachineSystem}-${COMPILER}/librocksdb.a* ${TarBall}/lib_static
endif
cp -a /usr/lib64/libzstd.so* ${TarBall}/lib
cp -a ../rocksdb/${UNAME_MachineSystem}-${COMPILER}/librocksdb.so* ${TarBall}/lib
cp -a ../rocksdb/${UNAME_MachineSystem}-${COMPILER}/db_bench ${TarBall}/bin
cp -a ../rocksdb/${UNAME_MachineSystem}-${COMPILER}/ldb ${TarBall}/bin
endif
cp -a ${BUILD_ROOT}/lib/lib${ToplingDcompact_lib}-{${COMPILER}-,}r${DLL_SUFFIX} ${TarBall}/lib
cp -a ${TerarkLibDir}/libterark-zbs-{${COMPILER}-,}r${DLL_SUFFIX} ${TarBall}/lib
cp -a ${TerarkLibDir}/libterark-fsa-{${COMPILER}-,}r${DLL_SUFFIX} ${TarBall}/lib
cp -a ${TerarkLibDir}/libterark-core-{${COMPILER}-,}r${DLL_SUFFIX} ${TarBall}/lib
cp src/table/terark_zip_table.h ${TarBall}/include/table
cp src/table/terark_zip_weak_function.h ${TarBall}/include/table
echo $(shell date "+%Y-%m-%d %H:%M:%S") > ${TarBall}/package.buildtime.txt
echo $(shell git log | head -n1) >> ${TarBall}/package.buildtime.txt
${TarBall}.tgz: ${TarBall}
cd pkg; tar czf ${TarBallBaseName}.tgz ${TarBallBaseName}
.PHONY: git-version.phony
${BUILD_ROOT}/git-version-%.cc: git-version.phony
@mkdir -p $(dir $@)
@rm -f [email protected]
@echo '__attribute__ ((visibility ("default"))) const char*' \
'git_version_hash_info_'$(patsubst git-version-%.cc,%,$(notdir $@))\
'() { return R"StrLiteral(git_version_hash_info_is:' > [email protected]
@env LC_ALL=C git log -n1 >> [email protected]
@env LC_ALL=C git diff >> [email protected]
@env LC_ALL=C $(CXX) --version >> [email protected]
@echo cpu_flag: $(CPU) >> [email protected]
@echo ')''StrLiteral";}' >> [email protected]
@# ^^----- To prevent diff causing git-version compile fail
@if test -f "$@" && cmp "$@" [email protected]; then \
rm [email protected]; \
else \
mv [email protected] $@; \
fi
3rdparty/etcd-cpp-apiv3/build/src/libetcd-cpp-api.so:
cd 3rdparty/etcd-cpp-apiv3; \
mkdir -p build; \
cd build; \
cmake -DCMAKE_TOOLCHAIN_FILE=${VCPKG_HOME}/scripts/buildsystems/vcpkg.cmake ..
+make -C 3rdparty/etcd-cpp-apiv3/build
%${DLL_SUFFIX}:
@echo "----------------------------------------------------------------------------------"
@echo "Creating dynamic library: $@"
@echo BOOST_INC=${BOOST_INC} BOOST_SUFFIX=${BOOST_SUFFIX}
@echo -e "OBJS:" $(addprefix "\n ",$(sort $(filter %.o,$^)))
@echo -e "LIBS:" $(addprefix "\n ",${LIBS})
@mkdir -p ${BUILD_ROOT}/lib
@rm -f $@
@rm -f $(subst -${COMPILER},, $@)
@${LD} -shared $(sort $(filter %.o,$^)) ${LDFLAGS} ${LIBS} -o ${CYG_DLL_FILE} ${CYGWIN_LDFLAGS}
cd ${BUILD_ROOT}/lib; ln -sf $(notdir $@) $(subst -${COMPILER},,$(notdir $@))
ifeq (CYGWIN, ${UNAME_System})
@cp -l -f ${CYG_DLL_FILE} /usr/bin
endif
%.a:
@echo "----------------------------------------------------------------------------------"
@echo "Creating static library: $@"
@echo BOOST_INC=${BOOST_INC} BOOST_SUFFIX=${BOOST_SUFFIX}
@echo -e "OBJS:" $(addprefix "\n ",$(sort $(filter %.o,$^)))
@echo -e "LIBS:" $(addprefix "\n ",${LIBS})
@mkdir -p ${BUILD_ROOT}/lib
@rm -f $@
@rm -f $(subst -${COMPILER},, $@)
@${AR} rcs $@ $(filter %.o,$^)
cd ${BUILD_ROOT}/lib; ln -sf $(notdir $@) $(subst -${COMPILER},,$(notdir $@))
.PHONY : install
install : ToplingDcompact
cp lib/* ${prefix}/lib/
.PHONY : clean
clean:
-rm -rf lib ${BUILD_ROOT} ${PRECOMPILED_HEADER_GCH}
.PHONY : test
test:
.PHONY : depends
depends : ${alldep}
ifneq ($(MAKECMDGOALS),cleanall)
ifneq ($(MAKECMDGOALS),clean)
-include ${alldep}
endif
endif
${ddir}/%.exe: ${ddir}/%.o
@echo Linking ... $@
${LD} ${LDFLAGS} -o $@ $< -L${BUILD_ROOT}/lib -L${TerarkLibDir}/lib -lterark-zbs-${COMPILER}-d -lterark-fsa-${COMPILER}-d -lterark-core-${COMPILER}-d ${LIBS}
${rdir}/%.exe: ${ddir}/%.o
@echo Linking ... $@
${LD} ${LDFLAGS} -o $@ $< -L${BUILD_ROOT}/lib -L${TerarkLibDir}/lib -lterark-zbs-${COMPILER}-r -lterark-fsa-${COMPILER}-r -lterark-core-${COMPILER}-r ${LIBS}
${ddir}/%.o: %.cpp
@echo file: $< "->" $@
@echo TERARK_INC=${TERARK_INC}
@echo BOOST_INC=${BOOST_INC} BOOST_SUFFIX=${BOOST_SUFFIX}
mkdir -p $(dir $@)
${CXX} ${CXX_STD} ${CPU} -c ${DBG_FLAGS} ${CXXFLAGS} ${INCS} $< -o $@
${rdir}/%.o: %.cpp
@echo file: $< "->" $@
@echo TERARK_INC=${TERARK_INC}
@echo BOOST_INC=${BOOST_INC} BOOST_SUFFIX=${BOOST_SUFFIX}
mkdir -p $(dir $@)
${CXX} ${CXX_STD} ${CPU} -c ${RLS_FLAGS} ${CXXFLAGS} ${INCS} $< -o $@
${ddir}/%.o: %.cc
@echo file: $< "->" $@
@echo TERARK_INC=${TERARK_INC}
@echo BOOST_INC=${BOOST_INC} BOOST_SUFFIX=${BOOST_SUFFIX}
mkdir -p $(dir $@)
${CXX} ${CXX_STD} ${CPU} -c ${DBG_FLAGS} ${CXXFLAGS} ${INCS} $< -o $@
${rdir}/%.o: %.cc
@echo file: $< "->" $@
@echo TERARK_INC=${TERARK_INC}
@echo BOOST_INC=${BOOST_INC} BOOST_SUFFIX=${BOOST_SUFFIX}
mkdir -p $(dir $@)
${CXX} ${CXX_STD} ${CPU} -c ${RLS_FLAGS} ${CXXFLAGS} ${INCS} $< -o $@
${ddir}/%.o : %.c
@echo file: $< "->" $@
mkdir -p $(dir $@)
${CC} -c ${CPU} ${DBG_FLAGS} ${CFLAGS} ${INCS} $< -o $@
${rdir}/%.o : %.c
@echo file: $< "->" $@
mkdir -p $(dir $@)
${CC} -c ${CPU} ${RLS_FLAGS} ${CFLAGS} ${INCS} $< -o $@
${ddir}/%.s : %.cpp ${PRECOMPILED_HEADER_GCH}
@echo file: $< "->" $@
${CXX} -S ${CPU} ${DBG_FLAGS} ${CXXFLAGS} ${INCS} $< -o $@
${rdir}/%.s : %.cpp ${PRECOMPILED_HEADER_GCH}
@echo file: $< "->" $@
${CXX} -S ${CPU} ${RLS_FLAGS} ${CXXFLAGS} ${INCS} $< -o $@
${ddir}/%.s : %.c ${PRECOMPILED_HEADER_GCH}
@echo file: $< "->" $@
${CC} -S ${CPU} ${DBG_FLAGS} ${CXXFLAGS} ${INCS} $< -o $@
${rdir}/%.s : %.c ${PRECOMPILED_HEADER_GCH}
@echo file: $< "->" $@
${CC} -S ${CPU} ${RLS_FLAGS} ${CXXFLAGS} ${INCS} $< -o $@
${rdir}/%.dep : %.c
@echo file: $< "->" $@
@echo INCS = ${INCS}
mkdir -p $(dir $@)
${CC} -M -MT $(basename $@).o ${INCS} $< > $@
${ddir}/%.dep : %.c
@echo file: $< "->" $@
@echo INCS = ${INCS}
mkdir -p $(dir $@)
${CC} -M -MT $(basename $@).o ${INCS} $< > $@
${rdir}/%.dep : %.cpp
@echo file: $< "->" $@
@echo INCS = ${INCS}
mkdir -p $(dir $@)
${CXX} ${CXX_STD} -M -MT $(basename $@).o ${INCS} $< > $@
${ddir}/%.dep : %.cpp
@echo file: $< "->" $@
@echo INCS = ${INCS}
mkdir -p $(dir $@)
${CXX} ${CXX_STD} -M -MT $(basename $@).o ${INCS} $< > $@