Makefile: compile the applications only when a file changed.
parent
95b7b76f6c
commit
c462bbafa1
|
@ -0,0 +1,17 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Should we run the build?
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
exec >& 2
|
||||
echo "Usage: $0 <exe>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exe=$1
|
||||
|
||||
# If the binary hasn't already be compiled.
|
||||
[ -f "${exe}" ] || exit 0
|
||||
|
||||
v=`find src/ -type f -newer "${exe}" | wc -l`
|
||||
test "${v}" != "0"
|
7
makefile
7
makefile
|
@ -1,5 +1,8 @@
|
|||
all: build
|
||||
|
||||
Q ?= @
|
||||
SHOULD_UPDATE = ./bin/should-update
|
||||
|
||||
NAME ?= John
|
||||
EMAIL ?= john@example.com
|
||||
|
||||
|
@ -61,9 +64,9 @@ permission-set:
|
|||
###################
|
||||
|
||||
build-server:
|
||||
shards build authd
|
||||
$(Q)-$(SHOULD_UPDATE) bin/authd && shards build authd
|
||||
build-client:
|
||||
shards build authc
|
||||
$(Q)-$(SHOULD_UPDATE) bin/authc && shards build authc
|
||||
|
||||
build: build-server build-client
|
||||
|
||||
|
|
Loading…
Reference in New Issue