MAKEFILE untuk OCFPCSC-0.0.1

CC = g++ -fPIC
LD = ld -export-dynamic
OBJS := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
JDK_HOME = /opt/oracle-jdk-bin-1.8.0.5
PCSC_HDRS = -I/usr/include/PCSC
PCSC_LIBS = -lpcsclite
INCLUDE = -I$(JDK_HOME)/include -I$(JDK_HOME)/include/linux -I$(JDK_HOME)/include/genunix $(PCSC_HDRS)
LIBNAME = libOCFPCSC1.so

all: $(LIBNAME)

clean:
 rm -f *.so *.o

install:
 cp -f *.so /usr/local/pcsc/lib

$(LIBNAME): $(OBJS)
$(LD) -Bsymbolic -shared $(OBJS) $(PCSC_LIBS) -lc -o $@

$(patsubst %.cpp,%.o,$(wildcard *.cpp)) : %.o : %.cpp
$(CC) $(CFLAGS) -c $< $(INCLUDE) $(DEFS)