Skip to content

Commit

Permalink
Avoid rebuilding the lib when not needed
Browse files Browse the repository at this point in the history
`create-dirs` being a phony target was always rebuilt.
Making it a file target enables make to determine if
it needs to be rebuilt or it can be skiped
  • Loading branch information
mgarciaisaia committed Oct 24, 2015
1 parent 2879625 commit bd535cd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ UNAME=$(shell uname)
# Clean and compile .so
all: release/libcspecs.so

create-dirs:
release/cspecs:
mkdir -p release/cspecs/

release/libcspecs.so: create-dirs $(OBJS)
release/libcspecs.so: release/cspecs/ $(OBJS)
$(CC) -shared -o "release/libcspecs.so" $(OBJS)

release/cspecs/%.o: cspecs/%.c
Expand Down Expand Up @@ -44,4 +44,4 @@ uninstall:
rm -f /usr/lib/libcspecs.so
rm -rf /usr/include/cspecs

.PHONY: all create-dirs clean install uninstall
.PHONY: all clean install uninstall

0 comments on commit bd535cd

Please sign in to comment.