Skip to content

Commit

Permalink
Makefile: No order-only dependencies (part 2)
Browse files Browse the repository at this point in the history
  • Loading branch information
attipaci committed Oct 15, 2024
1 parent 616cdb0 commit 1392e8c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 $@

Expand Down

0 comments on commit 1392e8c

Please sign in to comment.