#LIBPATH = -L$(HOME)/lib/

INCPATH = -I. -I../ObjectsMultiPlatform/Include -I/usr/include/PCSC

CFLAGS = -Wall -Dlinux -fPIC

LIBOBJECTS = \
	Bytearray.o Config.o ServerMessageReceiver.o \
	ServerPoll.o TLV.o \
	TLVBuffer.o winscarp.o \
	../ObjectsMultiPlatform/Libraries/Linux/*.a 

#################################
#  .+-----------------------+.  #
#  +  Generic Compile Rules  +  #
#  `+-----------------------+'  #
#################################


%.o: %.cpp
	gcc $(CFLAGS) $(INCPATH) `wx-config --cppflags` -c -o $@ $<

#################################
#  .+-----------------------+.  #
#  +  Labels                 +  #
#  `+-----------------------+'  #
#################################

ALL: shared

static: libpcsclitep.a

shared: libpcsclitep.so

clean:
	rm -f *core *.o
	rm -f *.so *.a

install: shared
	cp libpcsclitep.so.0.2 /usr/lib/
	ln -fs libpcsclitep.so.0.2 /usr/lib/libpcsclitep.so

#################################
#  .+-----------------------+.  #
#  +  Main targets to build  +  #
#  `+-----------------------+'  #
#################################

libpcsclitep.so: $(LIBOBJECTS)
	gcc  -shared -o libpcsclitep.so.0.2 $(LIBOBJECTS) `wx-config --libs` -lcrypto 

libpcsclitep.a: $(LIBOBJECTS)
	ar rcs libpcsclitep.a $(LIBOBJECTS)

