ROOT_PATH = ..

include ../Makefile.in

#OPCLIBS = libopc.so
#OPCINCS = opc.h opcrequestpool.h opcrequest.h

EXAMPLE1 = example1 
EXAMPLE2 = example2
EXAMPLE3 = example3
EXAMPLE4 = example4

OBJECTS = example1.o example2.o example3.o example4.o


#DEF=-Dmy_define=my_value
XMLINC=-I/usr/include/libxml2
INC=-I../includes -I../includes/libopc -I../includes/libds -I../3rd_party -I. $(XMLINC)
LIBS+=-L../libopc -L../libds -lopc -lds -ldl

vpath %.h ../include/:frontend:backend:../libopc:../libopc/request:../3rd_party
vpath %.so ../libopc

all: $(EXAMPLE1) $(EXAMPLE2) $(EXAMPLE3) $(EXAMPLE4)

install:

example1: example1.o  $(OPCLIBS)
	$(CC) -o $(EXAMPLE1) example1.o $(LIBS) -lc -lpthread -lcurl

example2: example2.o  $(OPCLIBS)
	$(CC) -o $(EXAMPLE2) example2.o $(LIBS) -lc -lpthread -lghttp

example3: example3.o  $(OPCLIBS)
	$(CC) -o $(EXAMPLE3) example3.o $(LIBS) -lc -lpthread

example4: example4.o  $(OPCLIBS)
	$(CC) -o $(EXAMPLE4) example4.o $(LIBS) -lc -lpthread -lcurl

$(OBJECTS):%.o:%.c $(INCLUDES) $(HEADERS) $(OPCINCS) dime.h dime2.h
	$(CC) -c $(CFLAGS) $(INC) $(DEF)  $< -o $@


clean:
	-rm -f *.{o,gcda,gcno,gcov} $(EXAMPLE1) $(EXAMPLE2) $(EXAMPLE3) output.xml
