tests/resource: Rework Makefile

In particular, fill in the install/uninstall rules so this test can be
packaged to be automated sensibly.

Make all object files depend on the Makefile, drop redundant -f's for $(RM),
and use $(TARGET) when appropriate.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Andrew Cooper committed 2021-07-09 16:38:27 +01:00
1 parent 79ca512a1f
commit ff759953b3
1 file changed
+8 -3
+8 -3
View File
@@ -12,17 +12,20 @@ run: $(TARGET)
.PHONY: clean
clean:
$(RM) -f -- *.o $(TARGET) $(DEPS_RM)
$(RM) -- *.o $(TARGET) $(DEPS_RM)
.PHONY: distclean
distclean: clean
$(RM) -f -- *~
$(RM) -- *~
.PHONY: install
install: all
$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
$(INSTALL_PROG) $(TARGET) $(DESTDIR)$(LIBEXEC_BIN)
.PHONY: uninstall
uninstall:
$(RM) -- $(DESTDIR)$(LIBEXEC_BIN)/$(TARGET)
CFLAGS += -Werror
CFLAGS += $(CFLAGS_xeninclude)
@@ -34,7 +37,9 @@ LDFLAGS += $(LDLIBS_libxenctrl)
LDFLAGS += $(LDLIBS_libxenforeignmemory)
LDFLAGS += $(APPEND_LDFLAGS)
test-resource: test-resource.o
%.o: Makefile
$(TARGET): test-resource.o
$(CC) -o $@ $< $(LDFLAGS)
-include $(DEPS_INCLUDE)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.