# build dynamically loaded lib libch.dl and libchcpp.dl

target: Makefile libch.dl libchcpp.dl

libch.dl: Makefile chvastart.o chglobalsymboladdrbyname.o \
           chcallfuncbyaddr.o chcallfuncbyaddr_1.o \
           chcallfuncbyaddr_2.o chcallfuncbyname.o \
           chcallfuncbynamev.o \
           chhome.o vararg.o chvaisfuncvararg.o chversion.o
	ch dllink libch.dl chvastart.o chglobalsymboladdrbyname.o \
           chcallfuncbyaddr.o chcallfuncbyaddr_1.o \
           chcallfuncbyaddr_2.o chcallfuncbyname.o \
           chcallfuncbynamev.o \
           chhome.o vararg.o chvaisfuncvararg.o chversion.o
libchcpp.dl: Makefile chuserdefinedname.o
	ch dllink libchcpp.dl cplusplus chuserdefinedname.o

chvastart.o:  chvastart.c
	ch dlcomp libch.dl chvastart.c

chcallfuncbyaddr.o:  chcallfuncbyaddr.c
	ch dlcomp libch.dl chcallfuncbyaddr.c

chglobalsymboladdrbyname.o:  chglobalsymboladdrbyname.c
	ch dlcomp libch.dl chglobalsymboladdrbyname.c

chcallfuncbyaddr_1.o:  chcallfuncbyaddr_1.c
	ch dlcomp libch.dl chcallfuncbyaddr_1.c

chcallfuncbyaddr_2.o:  chcallfuncbyaddr_2.c
	ch dlcomp libch.dl chcallfuncbyaddr_2.c

chcallfuncbyname.o:  chcallfuncbyname.c
	ch dlcomp libch.dl chcallfuncbyname.c

chcallfuncbynamev.o:  chcallfuncbynamev.c
	ch dlcomp libch.dl chcallfuncbynamev.c

chhome.o:  chhome.c
	ch dlcomp libch.dl chhome.c

chversion.o:  chversion.c
	ch dlcomp libch.dl chversion.c

chuserdefinedname.o:  chuserdefinedname.cpp
	ch dlcomp libch.dl cplusplus chuserdefinedname.cpp

vararg.o:  vararg.c
	ch dlcomp libch.dl vararg.c

chvaisfuncvararg.o:  chvaisfuncvararg.c
	ch dlcomp libch.dl chvaisfuncvararg.c

clear:
	rm -f *.o *.dl *.obj *.lib *.exp
