test: disable object dependencies in main makefile

When the main makefile is used to get the list of chronyd objects in
order to build the unit tests, clang started (with the -MM option) to
generate the dependency files prints error messages about wrong
inclusions. Set a NODEPS variable to completely disable the generation
of the files.
This commit is contained in:
Miroslav Lichvar 2020-06-08 15:14:22 +02:00
parent ea425bf01e
commit 428f9e4228
2 changed files with 4 additions and 1 deletions

View file

@ -134,4 +134,6 @@ Makefile : Makefile.in configure
.deps/%.d: %.c | .deps .deps/%.d: %.c | .deps
@$(CC) -MM $(CPPFLAGS) -MT '$(<:%.c=%.o) $@' $< -o $@ @$(CC) -MM $(CPPFLAGS) -MT '$(<:%.c=%.o) $@' $< -o $@
ifndef NODEPS
-include $(ALL_OBJS:%.o=.deps/%.d) -include $(ALL_OBJS:%.o=.deps/%.d)
endif

View file

@ -12,7 +12,8 @@ TEST_OBJS := $(sort $(patsubst %.c,%.o,$(wildcard *.c)))
TESTS := $(patsubst %.o,%.test,$(filter-out $(SHARED_OBJS),$(TEST_OBJS))) TESTS := $(patsubst %.o,%.test,$(filter-out $(SHARED_OBJS),$(TEST_OBJS)))
CHRONYD_OBJS := $(patsubst %.o,$(CHRONY_SRCDIR)/%.o,$(filter-out main.o,\ CHRONYD_OBJS := $(patsubst %.o,$(CHRONY_SRCDIR)/%.o,$(filter-out main.o,\
$(filter %.o,$(shell $(MAKE) -f $(CHRONY_SRCDIR)/Makefile print-chronyd-objects)))) $(filter %.o,$(shell $(MAKE) -f $(CHRONY_SRCDIR)/Makefile \
print-chronyd-objects NODEPS=1))))
all: $(TESTS) all: $(TESTS)