Fix few issue with this new directory:
- clean generated files
- and ignore those generated files
- include the dependency files generated by `gcc`.
- rework prerequisites:
"test-rangeset.o" also needs the generated files "list.h" and
"rangeset.h". Technically, both only needs "harness.h" which needs
the generated headers, but that's a bit simpler and the previous
point will add the dependency on "harness.h" automatically.
This last point fix an issue where `make` might decide to build
"test-rangeset.o" before the other files are ready.
Fixes: 7bf777b42cad ("tootls/tests: introduce unit tests for rangesets")
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
--- /dev/null
+/list.h
+/rangeset.c
+/rangeset.h
+/test-rangeset
.PHONY: clean
clean:
- $(RM) -- *.o $(TARGET) $(DEPS_RM)
+ $(RM) -- *.o $(TARGET) $(DEPS_RM) list.h rangeset.h rangeset.c
.PHONY: distclean
distclean: clean
list.h rangeset.h:
sed -e '/#include/d' <$< >$@
-rangeset.c: $(XEN_ROOT)/xen/common/rangeset.c list.h rangeset.h
+rangeset.c: $(XEN_ROOT)/xen/common/rangeset.c
# Remove includes and add the test harness header
sed -e '/#include/d' -e '1s/^/#include "harness.h"/' <$< >$@
LDFLAGS += $(APPEND_LDFLAGS)
+test-rangeset.o rangeset.o: list.h rangeset.h
+
test-rangeset: rangeset.o test-rangeset.o
$(CC) $^ -o $@ $(LDFLAGS)
+
+-include $(DEPS_INCLUDE)