.PHONY: run run: main ./main main: main.c libAB.so Makefile $(CC) -g -o $@ $< -ldl -Wl,-rpath='$$ORIGIN' libA.so: a.c Makefile $(CC) -g -o $@ $< -fPIC -shared -ldl libB.so: b.c Makefile $(CC) -g -o $@ $< -fPIC -shared -Wl,-rpath='$$ORIGIN' libAB.so: ab.c libA.so libB.so Makefile $(CC) -g -o $@ $< -fPIC -shared -L. -Wl,-rpath='$$ORIGIN' -lB -lA