test: include all objects in prerequisites of unit tests

This commit is contained in:
Miroslav Lichvar 2018-09-13 10:24:06 +02:00
parent 6375307798
commit dbcb1b9b0b

View file

@ -16,8 +16,10 @@ CHRONYD_OBJS := $(patsubst %.o,$(CHRONY_SRCDIR)/%.o,$(filter-out main.o,\
all: $(TESTS)
%.test: %.o $(SHARED_OBJS)
$(CC) $(CFLAGS) -o $@ $^ $(CHRONYD_OBJS:%/$*.o=) $(LDFLAGS)
$(CHRONY_OBJS): ;
%.test: %.o $(SHARED_OBJS) $(CHRONYD_OBJS)
$(CC) $(CFLAGS) -o $@ $(filter-out $(CHRONY_SRCDIR)/$<,$^) $(LDFLAGS)
%.o: %.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c $<