Author: Nilesh Patra <npatra974@gmail.com>,
        Andreas Tille <tille@debian.org>
Last-Update: Fri, 23 Oct 2020 22:10:01 +0200
Description: Fix unused variable

--- a/Makefile
+++ b/Makefile
@@ -10,6 +10,7 @@ BUILD := release
 
 TOOLSET := gcc
 build_dir := ${CURDIR}/build/${BUILD}/${TOOLSET}
+build_dir_shared := ${CURDIR}/build_shared/${BUILD}/${TOOLSET}
 
 cxx.gcc := g++
 cc.gcc := gcc
@@ -61,21 +62,30 @@ ldlibs.moodycamel :=
 cppflags.xenium := -I${abspath ../xenium}
 ldlibs.xenium :=
 
+SOVERSION := 0
 COMPILE.CXX = ${CXX} -o $@ -c ${cppflags} ${cxxflags} -MD -MP $(abspath $<)
 COMPILE.S = ${CXX} -o- -S -masm=intel ${cppflags} ${cxxflags} $(abspath $<) | c++filt | egrep -v '^[[:space:]]*\.(loc|cfi|L[A-Z])' > $@
 PREPROCESS.CXX = ${CXX} -o $@ -E ${cppflags} ${cxxflags} $(abspath $<)
 COMPILE.C = ${CC} -o $@ -c ${cppflags} ${cflags} -MD -MP $(abspath $<)
 LINK.EXE = ${LD} -o $@ $(ldflags) $(filter-out Makefile,$^) $(ldlibs)
-LINK.SO = ${LD} -o $@ -shared $(ldflags) $(filter-out Makefile,$^) $(ldlibs)
+LINK.SO = ${LD} -o $@.$(SOVERSION) -shared -Wl,-soname,`basename $@`.$(SOVERSION) $(ldflags) $(filter-out Makefile,$^) $(ldlibs)
 LINK.A = ${AR} rscT $@ $(filter-out Makefile,$^)
 
 exes := benchmarks tests example
 
 all : ${exes}
 
-${exes} : % : ${build_dir}/%
+${exes} : % : ${build_dir}/% ${build_dir}/libatomic_queue.a  ${build_dir_shared}/libatomic_queue.so
 	ln -sf ${<:${CURDIR}/%=%}
 
+${build_dir}/libatomic_queue.a : $(addprefix ${build_dir}/,cpu_base_frequency.o huge_pages.o)
+-include ${build_dir}/cpu_base_frequency.d
+-include ${build_dir}/huge_pages.d
+
+${build_dir_shared}/libatomic_queue.so : $(addprefix ${build_dir_shared}/,cpu_base_frequency.o huge_pages.o)
+-include ${build_dir_shared}/cpu_base_frequency.d
+-include ${build_dir_shared}/huge_pages.d
+
 benchmarks_src := benchmarks.cc cpu_base_frequency.cc huge_pages.cc
 ${build_dir}/benchmarks : cppflags += ${cppflags.tbb} ${cppflags.moodycamel} ${cppflags.xenium}
 ${build_dir}/benchmarks : ldlibs += ${ldlibs.tbb} ${ldlibs.moodycamel} ${ldlibs.xenium} -ldl
@@ -95,9 +105,10 @@ ${build_dir}/example : ${example_src:%.c
 	$(strip ${LINK.EXE})
 -include ${example_src:%.cc=${build_dir}/%.d}
 
-${build_dir}/%.so : cxxflags += -fPIC
-${build_dir}/%.so : Makefile | ${build_dir}
-	$(strip ${LINK.SO})
+${build_dir_shared}/%.so : cxxflags += -fPIC
+${build_dir_shared}/%.so : Makefile | ${build_dir_shared}
+	${LINK.SO}
+	ln -s `basename $@`.$(SOVERSION) $@
 
 ${build_dir}/%.a : Makefile | ${build_dir}
 	$(strip ${LINK.A})
@@ -122,6 +133,13 @@ ${build_dir}/%.o : src/%.cc Makefile | $
 ${build_dir}/%.o : src/%.c Makefile | ${build_dir}
 	$(strip ${COMPILE.C})
 
+${build_dir_shared}/%.o : src/%.cc Makefile | ${build_dir_shared}
+	$(strip ${COMPILE.CXX})
+
+${build_dir_shared}/%.o : src/%.c Makefile | ${build_dir_shared}
+	$(strip ${COMPILE.C})
+
+
 %.S : cppflags += ${cppflags.tbb} ${cppflags.moodycamel} ${cppflags.xenium}
 %.S : src/%.cc Makefile | ${build_dir}
 	$(strip ${COMPILE.S})
@@ -132,11 +150,14 @@ ${build_dir}/%.o : src/%.c Makefile | ${
 ${build_dir} :
 	mkdir -p $@
 
+${build_dir_shared} :
+	mkdir -p $@
+
 rtags : clean
 	${MAKE} -nk | rc -c -; true
 
 clean :
-	rm -rf ${build_dir} ${exes}
+	rm -rf ${build_dir} ${exes} ${build_dir_shared}
 
 env :
 	env | sort
