1# SPDX-License-Identifier: LGPL-2.1 2 3include $(src)/scripts/utils.mk 4 5TARGETS = $(bdir)/trace-utest 6 7OBJS = 8OBJS += trace-utest.o 9OBJS += traceevent-utest.o 10 11LIBS += -lcunit \ 12 -ldl \ 13 $(LIBTRACEEVENT_STATIC) 14 15OBJS := $(OBJS:%.o=$(bdir)/%.o) 16DEPS := $(OBJS:$(bdir)/%.o=$(bdir)/.%.d) 17 18$(OBJS): | $(bdir) 19$(DEPS): | $(bdir) 20 21$(bdir)/trace-utest: $(OBJS) $(LIBTRACEEVENT_STATIC) 22 $(Q)$(do_app_build) 23 24$(bdir)/%.o: %.c 25 $(Q)$(call do_fpic_compile) 26 27$(DEPS): $(bdir)/.%.d: %.c 28 $(Q)$(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@ 29 $(Q)$(CC) -M -MT $(bdir)/$*.o $(CPPFLAGS) $(CFLAGS) $< > $@ 30 31$(OBJS): $(bdir)/%.o : $(bdir)/.%.d 32 33dep_includes := $(wildcard $(DEPS)) 34 35test: $(TARGETS) 36 37clean: 38 $(Q)$(call do_clean,$(TARGETS) $(bdir)/*.o $(bdir)/.*.d) 39