<file_sep>#include "shared.h"
template <class Type> void myclass<Type>::setx(Type y) { x = y; }
template <class Type> Type myclass<Type>::getx() { return x; }
// Instantiate myclass for the supported template type parameters
template class myclass<int>;
template class myclass<long>;
<file_sep>template <class Type> class myclass {
  Type x;
public:
  myclass() { x=0; }
  void setx(Type y);
  Type  getx();
};

<file_sep>CXX  = g++

CXXFLAGS  = -g -Wall -fPIC -Wno-deprecated -O3
CXXFLAGS += -std=c++14

all: libshared.so main

shared.o: shared.cpp
	$(CXX) $(CXXFLAGS) -c $^ -o $@

libshared.so: shared.o	
	$(CXX) -o $@ -shared $^

main: main.cpp
	$(CXX) -c $< -o main.o
	$(CXX) -o $@ main.o -L. -lshared

.PHONY : printmakehelp_and_reminder
printmakehelp_and_reminder: Makefile  README
	$(info  /**********************************************************************/)
	$(info  * task --> printmakehelp_and_reminder: Makefile  README               *)
	$(info  * $$@ ----> $@                                 *)
	$(info  * $$< --------------------------------> $<                       *)
	$(info  * $$^ --------------------------------> $^                *)
	$(info  /**********************************************************************/)

export_LD_LIBRARY_PATH:
	@echo export LD_LIBRARY_PATH=/home/burmist/home2/training/034_Cpp_Shared_Library_with_Templates/s02

print_LD_LIBRATY_PATH:
	@echo LD_LIBRARY_PATH = $(value LD_LIBRARY_PATH)

.PHONY : clean
clean:
	rm -f *~
	rm -f .*~
	rm -f *.o
	rm -f *.so
	rm -f main
<file_sep>#include "shared.h"
//template <class Type> void myclass<Type>::setx(Type y) { x = y; }
//template <class Type> Type myclass<Type>::getx() { return x; }
// Instantiate myclass for the supported template type parameters
//template class myclass<int>;
//template class myclass<long>;
<file_sep>template <class Type> class myclass {
  Type x;
public:
  myclass() { x=0; }
  void setx(Type y);
  Type  getx();
};

template <class Type> void myclass<Type>::setx(Type y) { x = y; }
template <class Type> Type myclass<Type>::getx() { return x; }

