# build dynamically loaded  lib libsample.dl

target: libsample.dl

# -lm for func1() and func2() using functions in lib libm.so
libsample.dl: sample_chdl.o func3_chdl.o func.o
	ch dllink libsample.dl sample_chdl.o \
                  func3_chdl.o func.o -lm
sample_chdl.o:  sample_chdl.c
	ch dlcomp libsample.dl sample_chdl.c -I../src
func3_chdl.o:  handmade/sample/func3_chdl.c
	ch dlcomp libsample.dl handmade/sample/func3_chdl.c -I../src
func.o:  ../src/func.c
	ch dlcomp libsample.dl ../src/func.c -I../src
clean:
	rm -f *.o *.dl *.a *.dll *.lib *.exp *.obj

