LIBS=libproba.a OBJS=proba.o SHARED=libproba.so CFLAGS=-I. LDFLAGS=-L. TARGETS=test tests testsp test2 all: $(TARGETS) libproba.a: $(OBJS) $(AR) rvs $@ $^ libproba.so: $(OBJS) $(CC) -shared $(CFLAGS) $(LDFLAGS) -o $@ $^ test: test.c proba.h $(SHARED) $(LIBS) $(CC) $(CFLAGS) $(LDFLAGS) -lproba -o $@ $< test2: test2.c $(SHARED) $(LIBS) $(CC) $(CFLAGS) $(LDFLAGS) -ldl -o $@ $< .PHONY: runtest runtest: test $(SHARED) LD_LIBRARY_PATH=$(PWD) $(PWD)/test runtest2: test2 $(SHARED) LD_LIBRARY_PATH=$(PWD) $(PWD)/test2 tests: test.c proba.h $(LIBS) $(CC) -static $(CFLAGS) $(LDFLAGS) $< -o $@ -lproba testsp: test.c proba.h $(LIBS) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -Wl,-dn -lproba -Wl,-dy .PHONY: runtests runtests: tests -$(PWD)/tests clean: -$(RM) $(LIBS) $(SHARED) $(OBJS) $(TARGETS)