# Standard symbols CC = gcc CCFLAGS = -fPIC -Wall -I ../include -ggdb LDFLAGS = -L ../../miniade/lib # Custom symbols LIBNAME = miniade MEMBERS = miniade LIBVER_LONG = 0.0.1 LIBVER_SHORT = $(firstword $(subst ., , $(LIBVER_LONG))) # Standard recipes default: compile compile: lib$(LIBNAME).so.$(LIBVER_LONG) clean: $(RM) *.o lib$(LIBNAME).so.$(LIBVER_LONG) lib$(LIBNAME).so.$(LIBVER_SHORT) # Custom recipes lib$(LIBNAME).so.$(LIBVER_LONG): $(patsubst %, %.o, $(MEMBERS)) $(CC) -shared -Wl,-soname,lib$(LIBNAME).so.$(LIBVER_SHORT) -o $@ $(patsubst %, %.o, $(MEMBERS)) ln -sf $@ lib$(LIBNAME).so.$(LIBVER_SHORT) %.o: %.c $(CC) $(CCFLAGS) -c $^