.SUFFIXES: .cpp

CPCCC=$(CCC)
CPCCC=$(CXX)
# For FreeBSD you should add -pthread to LDFLAGS.
CFLAGS=-DUNIX -DHAVE_LIMITS_H $(ARCH_FLAGS) $(add_CPPFLAGS) -I$(CSP_INCLUDE)/ -I$(CSP_INCLUDE)/cpcsp -I$(CSP_INCLUDE)/pki -DSIZEOF_VOID_P=$(SIZEOF_VOID_P) -g
#CFLAGS+=-I/opt/cprocsp/include/pki
LDFLAGS= $(ARCH_FLAGS) -L$(CSP_LIB) -lcapi20 -lcapi10 $(CSP_LIB)/libcades.so.2 $(CSP_LIB)/libxades.so.2 -lrdrsup $(add_ldflags) -g

OBJS=$(out).o
$(out): $(OBJS)
	$(CPCCC) $(OBJS) $(LDFLAGS) -o $@ $(add_libs)
clean:
	for i in $(out) $(OBJS) ; do test -r "$$i" || continue ; rm "$$i" ; done
.cpp.o:
	$(CPCCC) $(CFLAGS) -c -o $@ $<
