mirror of
https://github.com/linux-msm/qdl.git
synced 2026-02-25 13:12:25 -08:00
make: don't rebuild util.o (and dependencies) unnecessary
Using fake target name forces make to rebuild all targets that depend on it. Properly specify version.h as a target name and use double-colon to let make know that it's a special build target. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
This commit is contained in:
6
Makefile
6
Makefile
@@ -16,7 +16,7 @@ KS_OUT := ks
|
||||
KS_SRCS := ks.c sahara.c util.c ux.c
|
||||
KS_OBJS := $(KS_SRCS:.c=.o)
|
||||
|
||||
default: versionfile $(QDL) $(RAMDUMP) $(KS_OUT)
|
||||
default: $(QDL) $(RAMDUMP) $(KS_OUT)
|
||||
|
||||
$(QDL): $(QDL_OBJS)
|
||||
$(CC) -o $@ $^ $(LDFLAGS)
|
||||
@@ -30,11 +30,11 @@ $(KS_OUT): $(KS_OBJS)
|
||||
compile_commands.json: $(QDL_SRCS) $(KS_SRCS)
|
||||
@echo -n $^ | jq -snR "[inputs|split(\" \")[]|{directory:\"$(PWD)\", command: \"$(CC) $(CFLAGS) -c \(.)\", file:.}]" > $@
|
||||
|
||||
versionfile:
|
||||
version.h::
|
||||
@echo "#define VERSION \"$(VERSION)\"" > .version.h
|
||||
@cmp -s .version.h version.h || cp .version.h version.h
|
||||
|
||||
util.o: versionfile
|
||||
util.o: version.h
|
||||
|
||||
clean:
|
||||
rm -f $(QDL) $(QDL_OBJS)
|
||||
|
||||
Reference in New Issue
Block a user