diff --git a/build.mk b/build.mk index 562af0d..3f4251e 100644 --- a/build.mk +++ b/build.mk @@ -10,19 +10,19 @@ $(OBJ)/%.o: %.c dep/%.d $(OBJ) Makefile $(CC) -o $@ -c $(CPPFLAGS) $(CFLAGS) $< -# Share librarry recipe -$(LIB)/%.so.$(SO_VERSION) : | $(LIB) Makefile +# Share library recipe +$(LIB)/%.so.$(SO_VERSION) : + @if [ ! -e $(LIB) ] ; then make $(LIB); fi $(CC) -o $@ $(CPPFLAGS) $(CFLAGS) $^ -shared -fPIC -Wl,-soname,$(subst $(LIB)/,,$@) $(LDFLAGS) # Unversioned shared libs (for linking against) $(LIB)/lib%.so: - @if [ ! -e $(LIB) ] ; then mkdir $(LIB); fi @rm -f $@ ln -sr $< $@ # Static library: *.a $(LIB)/%.a: - @if [ ! -e $(LIB) ] ; then mkdir $(LIB); fi + @if [ ! -e $(LIB) ] ; then make $(LIB); fi ar -rc $@ $^ ranlib $@