[Makefile] fix missing rules preventing dry-runs

Sun, 17 Dec 2023 14:25:34 +0100

author
Mike Becker <universe@uap-core.de>
date
Sun, 17 Dec 2023 14:25:34 +0100
changeset 797
edbb20b1438d
parent 796
81e0f67386a6
child 798
d7f5067a27ce

[Makefile] fix missing rules preventing dry-runs

We have to support dry-runs, because many IDEs are using
dry-runs to collect build information.

Some rules have dependencies that expect certain files or
directories to be just present. We added respective build
rules which invoke the test program. This way, the behavior
when running make normally is exactly the same, but dry-runs
are also not failing now.

dav/Makefile file | annotate | diff | comparison | revisions
libidav/Makefile file | annotate | diff | comparison | revisions
test/Makefile file | annotate | diff | comparison | revisions
--- a/dav/Makefile	Sat Sep 30 17:26:00 2023 +0200
+++ b/dav/Makefile	Sun Dec 17 14:25:34 2023 +0100
@@ -83,6 +83,8 @@
 ../build/tool/%$(OBJ_EXT): %.c 
 	$(CC) -I../ucx -I../ $(CFLAGS) $(DAV_CFLAGS) -c -o $@ $<
 
+../build/lib/libidav$(LIB_EXT):
+	test -f '$@'
 
 cppcheck: $(DAV_SRC) $(SYNC_SRC)
 	$(CPPCHECK) $(CPPCHECK_CONFIG) -I../ucx  $(CPPCHECK_FLAGS) $+ 2>> ../$(CPPCHECK_LOG)
--- a/libidav/Makefile	Sat Sep 30 17:26:00 2023 +0200
+++ b/libidav/Makefile	Sun Dec 17 14:25:34 2023 +0100
@@ -53,6 +53,9 @@
 ../build/libidav/%$(OBJ_EXT): %.c
 	$(CC) -I../ucx $(CFLAGS) $(DAV_CFLAGS) -c -o $@ $<
 
+../build/ucx:
+	test -d '$@'
+
 cppcheck: $(SRC)
 	$(CPPCHECK) $(CPPCHECK_CONFIG) -I../ucx $(CPPCHECK_FLAGS) $+ 2>> ../$(CPPCHECK_LOG)
 
--- a/test/Makefile	Sat Sep 30 17:26:00 2023 +0200
+++ b/test/Makefile	Sun Dec 17 14:25:34 2023 +0100
@@ -51,3 +51,5 @@
 ../build/test/%$(OBJ_EXT): %.c 
 	$(CC) $(CFLAGS) $(DAV_CFLAGS) -I../ucx -I../ -c -o $@ $<
 
+../build/lib/libidav$(LIB_EXT):
+	test -f '$@'

mercurial