debuggers.hg

view config/StdGNU.mk @ 16988:0faf620bc749

build: Make PREFIX work by fixing LIBDIR

In the current tree, setting PREFIX does not work very well. This is
because of confusion about the meaning of LIBDIR. In some places it
is the pathname tail of directories containing libraries (lib, lib64
or lib/amd64). But in other places it is a destination pathname
(implicitly, including any PREFIX). This can result in PREFIX or /usr
being added the wrong number of times.

This patch splits LIBDIR into two variables, LIBLEAFDIR and
LIBDIR. LIBDIR is the directory into which Xen libraries and other
similar code is to be placed, and includes any PREFIX. LIBLEAFDIR is
just the library tail and can be appended to various different
prefixes; for example, to construct the X11 library directory for -L.

Neither variable contains the value of DESTDIR, which is of course
used only to redirect the results of `make install' when desired.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jan 31 09:38:34 2008 +0000 (2008-01-31)
parents 221b867ee084
children f3b418afc6be
line source
1 AS = $(CROSS_COMPILE)as
2 LD = $(CROSS_COMPILE)ld
3 CC = $(CROSS_COMPILE)gcc
4 CPP = $(CC) -E
5 AR = $(CROSS_COMPILE)ar
6 RANLIB = $(CROSS_COMPILE)ranlib
7 NM = $(CROSS_COMPILE)nm
8 STRIP = $(CROSS_COMPILE)strip
9 OBJCOPY = $(CROSS_COMPILE)objcopy
10 OBJDUMP = $(CROSS_COMPILE)objdump
12 MSGFMT = msgfmt
13 MSGMERGE = msgmerge
15 INSTALL = install
16 INSTALL_DIR = $(INSTALL) -d -m0755 -p
17 INSTALL_DATA = $(INSTALL) -m0644 -p
18 INSTALL_PROG = $(INSTALL) -m0755 -p
20 PREFIX ?= /usr
21 BINDIR = $(PREFIX)/bin
22 INCLUDEDIR = $(PREFIX)/include
23 LIBLEAFDIR = lib
24 LIBLEAFDIR_x86_64 = lib64
25 LIBDIR = $(PREFIX)/$(LIBLEAFDIR)
26 LIBDIR_x86_64 = $(PREFIX)/$(LIBLEAFDIR_x86_64)
27 MANDIR = $(PREFIX)/share/man
28 MAN1DIR = $(MANDIR)/man1
29 MAN8DIR = $(MANDIR)/man8
30 SBINDIR = $(PREFIX)/sbin
32 PRIVATE_PREFIX = $(LIBDIR)/xen
33 PRIVATE_BINDIR = $(PRIVATE_PREFIX)/bin
35 SOCKET_LIBS =
36 CURSES_LIBS = -lncurses
37 UTIL_LIBS = -lutil
38 SONAME_LDFLAG = -soname
39 SHLIB_CFLAGS = -shared
41 ifneq ($(debug),y)
42 # Optimisation flags are overridable
43 CFLAGS ?= -O2 -fomit-frame-pointer
44 else
45 # Less than -O1 produces bad code and large stack frames
46 CFLAGS ?= -O1 -fno-omit-frame-pointer
47 endif