mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 18:21:39 +01:00
Old enough glibc has clock_gettime() in librt.so, hence the library
needs to be specified to the linker. Newer glibc has the symbol
available in both libraries, so make sure that libc.so is preferred (to
avoid an unnecessary dependency on librt.so).
Fixes: 93c9edbef5 ("tests/xenstore: Rework Makefile")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Acked-by: Ian Jackson <iwj@xenproject.org>
46 lines
818 B
Makefile
46 lines
818 B
Makefile
XEN_ROOT=$(CURDIR)/../../..
|
|
include $(XEN_ROOT)/tools/Rules.mk
|
|
|
|
TARGETS-y := test-xenstore
|
|
TARGETS := $(TARGETS-y)
|
|
|
|
.PHONY: all
|
|
all: build
|
|
|
|
.PHONY: build
|
|
build: $(TARGETS)
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
$(RM) -- *.o $(TARGETS) $(DEPS_RM)
|
|
|
|
.PHONY: distclean
|
|
distclean: clean
|
|
$(RM) -- *~
|
|
|
|
.PHONY: install
|
|
install: all
|
|
$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
|
|
$(if $(TARGETS),$(INSTALL_PROG) $(TARGETS) $(DESTDIR)$(LIBEXEC_BIN))
|
|
|
|
.PHONY: uninstall
|
|
uninstall:
|
|
$(RM) -- $(addprefix $(DESTDIR)$(LIBEXEC_BIN)/,$(TARGETS))
|
|
|
|
CFLAGS += -Werror
|
|
CFLAGS += $(CFLAGS_libxenstore)
|
|
CFLAGS += $(APPEND_CFLAGS)
|
|
|
|
LDFLAGS += $(LDLIBS_libxenstore)
|
|
LDFLAGS += $(APPEND_LDFLAGS)
|
|
ifeq ($(CONFIG_Linux),y)
|
|
LDFLAGS += -Wl,--as-needed -lc -lrt
|
|
endif
|
|
|
|
%.o: Makefile
|
|
|
|
test-xenstore: test-xenstore.o
|
|
$(CC) -o $@ $< $(LDFLAGS)
|
|
|
|
-include $(DEPS_INCLUDE)
|