# cvsid: $Id: Makefile.sample.in,v 1.10 2014/11/26 13:59:34 rjs Exp $
#
# sample Makefile for PLOP applications
# This may have to be changed for your build environment

RM	= rm -f

CXX = arm-linux-androideabi-g++
SAMPLE_CFLAGS = 
SAMPLE_CXXFLAGS = 
SAMPLE_LDFLAGS = 
SAMPLE_LDLIBS = 
SAMPLE_DLLDLIBS = 

CFLAGS	= -I../c/include $(SAMPLE_CFLAGS)
CXXFLAGS= -I../c/include $(SAMPLE_CXXFLAGS)
LDFLAGS	= -L../c/lib $(SAMPLE_LDFLAGS)
LDLIBS	= -lplop -lm $(SAMPLE_LDLIBS) $(SAMPLE_DLLDLIBS)

PROGS	= \
	encrypt \
	insertxmp  \
	dumper \
	multisign \
	sign

all: $(PROGS)

test: all
	@echo "to test the hellosign sample use: make testhellosign"
	-./encrypt
	-./insertxmp
	-./dumper PLOP-datasheet.pdf
	-./multisign invoice.pdf PLOP-datasheet.pdf
	-./sign invoice.pdf invoice-signed.pdf

hellosign:
	@echo "you need a version of PDFlib installed to build this target"
	$(CXX) hellosign.cpp $(CXXFLAGS) $(LDFLAGS) -lpdf $(LDLIBS) -o hellosign

testhellosign: hellosign
	-./hellosign

clean:
	$(RM) $(PROGS) *.o
	$(RM) hellosign PLOP-datasheet-encrypted.pdf PLOP-datasheet-xmp.pdf
	$(RM) hellosign.pdf invoice-signed.pdf

#  As we need a C++ linker change the default rules how to create executables
.SUFFIXES:
.SUFFIXES: .c .cpp

.c:
	$(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) $< $(LDLIBS)

.cpp:
	$(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) $< $(LDLIBS)

