-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile.in
66 lines (53 loc) · 1.84 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
ARCH = @target_arch@
CC = @CC@
CXX = @CXX@
prefix = @prefix@
exec_prefix = @exec_prefix@
# we have two options: build against installed system libraries and headers,
# or build against a xen source tree. We have to set flags accordingly
ifeq (@use_syslibs@,y)
# OPTION 1: build against system libraries and headers
ARCH = @target_arch@
CPPFLAGS += -D__XEN_TOOLS__ -Iinclude
CFLAGS += @oflags@ -Wall -Wextra -MMD -MF .$(if $(filter-out .,$(@D)),$(subst /,@,$(@D))@)$(@F).d
CXXFLAGS += @oflags@ -Wall -Wextra -MMD -MF .$(if $(filter-out .,$(@D)),$(subst /,@,$(@D))@)$(@F).d
ifeq (@hypercall_lib@,libxc)
LDLIBS += -lxenctrl
else
LDLIBS += -lxencall -lxenforeignmemory
endif
else
# OPTION 2: build against Xen source tree
XEN_ROOT ?= $(realpath @xenroot@)
include $(XEN_ROOT)/tools/Rules.mk
CPPFLAGS += -D__XEN_TOOLS__ -Iinclude
CFLAGS += $(CFLAGS_libxenctrl) @oflags@ -Wall -Wextra
CXXFLAGS += @oflags@ -Wall -Wextra -MMD -MF .$(if $(filter-out .,$(@D)),$(subst /,@,$(@D))@)$(@F).d
ifeq (@hypercall_lib@,libxc)
LDLIBS += $(LDLIBS_libxenctrl)
else
LDLIBS += $(LDLIBS_libxencall) $(LDLIBS_libxenforeignmemory)
endif
endif
LDLIBS += @libunwind@
BIN = uniprof symbolize
OBJ = $(addsuffix .o,$(BIN)) xen-interface-common.o xen-interface-$(ARCH).o
DEP = $(addprefix .,$(addsuffix .d,$(OBJ)))
.PHONY: all
all: $(BIN)
.PHONY: clean distclean
clean:
$(RM) *.a *.so *.o $(BIN) $(DEP) $(OBJ)
distclean: clean
-rm -rf autom4te.cache/
$(RM) config.log autoscan.log config.cache config.log config.status include/config.h Makefile
install: $(BIN)
/bin/cp -v $(BIN) @bindir@/
.PHONY: uninstall
uninstall:
rm -vf $(addprefix @bindir@/, $(BIN))
uniprof: uniprof.o xen-interface-common.o xen-interface-$(ARCH).o
$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) $(APPEND_LDFLAGS)
symbolize: symbolize.o
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $< $(APPEND_LDFLAGS)
-include $(DEP)