exec := bar
sofile := libfoo.so.0.0.0
all: $(exec)
$(exec): $(sofile)
$(sofile): foo.o
	gcc -shared -o $@ -Wl,-soname,libfoo.so.0 $(LDFLAGS) $^ $(LDLIBS)
install: all
	install -Dt$(DESTDIR)/usr/bin $(exec)
	install -Dt$(DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH) $(sofile)
	cd $(DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH) && ln -s $(sofile) libfoo.so.0
	cd $(DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH) && ln -s libfoo.so.0 libfoo.so
clean:
	rm -f *~ *.o $(sofile) $(exec) debian/files
	rm -fr debian/.debputy debian/tmp
