mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
Description: use DESTDIR correctly Standard makefiles always attempt to install to the root(/). Setting DESTDIR is the normal way to install to an alternative location. Setting prefix has the possibility of breaking programs, as the prefix may have been embedded inside a compiled binary. From: Adam Heath <doogie@brainfood.com> Signed-off-by: ian.pratt@cl.cam.ac.uk
38 lines
807 B
Makefile
38 lines
807 B
Makefile
INSTALL = install
|
|
INSTALL_PROG = $(INSTALL) -m0755
|
|
INSTALL_DIR = $(INSTALL) -d -m0755
|
|
|
|
XEN_ROOT=../..
|
|
include $(XEN_ROOT)/tools/Make.defs
|
|
|
|
CC = gcc
|
|
CFLAGS = -Wall -Werror -O3
|
|
|
|
INCLUDES += -I $(XEN_XC)
|
|
INCLUDES += -I $(XEN_LIBXC)
|
|
CFLAGS += $(INCLUDES)
|
|
|
|
HDRS = $(wildcard *.h)
|
|
|
|
TARGETS = xenperf
|
|
|
|
INSTALL_BIN = $(TARGETS) xencons
|
|
INSTALL_SBIN = netfix xm xend xensv xenperf
|
|
|
|
all: $(TARGETS)
|
|
$(MAKE) -C miniterm
|
|
|
|
install: all
|
|
$(INSTALL_DIR) $(DESTDIR)/usr/bin
|
|
$(INSTALL_DIR) $(DESTDIR)/usr/sbin
|
|
$(INSTALL_PROG) $(INSTALL_BIN) $(DESTDIR)/usr/bin
|
|
$(INSTALL_PROG) $(INSTALL_SBIN) $(DESTDIR)/usr/sbin
|
|
$(MAKE) -C miniterm install
|
|
|
|
clean:
|
|
$(RM) *.o $(TARGETS) *~
|
|
$(MAKE) -C miniterm clean
|
|
|
|
%: %.c $(HDRS) Makefile
|
|
$(CC) $(CFLAGS) -o $@ $< -L$(XEN_LIBXC) -lxc -L$(XEN_LIBXUTIL) -lxutil
|