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

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

CFLAGS = -Wall -Dlinux -fPIC

LIBOBJECTS = \
	Bytearray.o Config.o StdAfx.o TLV.o TLVBuffer.o \
	ApplicationManager.o ApplicationObject.o CardChangeMonitor.o \
	CRLScheduler.o DefaultHandler.o PCSCManager.o ReaderObject.o \
	ReaderState.o SCardHandler.o wxmainapp.o TransactionStack.o \
	../ObjectsMultiPlatform/Libraries/Linux/*.a 

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


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

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

ALL: belpic

belpic : belpic_pcscd

clean:
	rm -f *core *.o
	rm -f belpcscd

install: belpic
	cp belpcscd /usr/sbin/

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

belpic_pcscd: $(LIBOBJECTS)
	gcc  -o belpcscd $(LIBOBJECTS) `wxbase-2.4-config --libs` -lcrypto -lssl -lpcsclite

