debuggers.hg

annotate 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
rev   line source
kfraser@11844 1 AS = $(CROSS_COMPILE)as
kfraser@11844 2 LD = $(CROSS_COMPILE)ld
kfraser@11844 3 CC = $(CROSS_COMPILE)gcc
ewan@14569 4 CPP = $(CC) -E
kfraser@11844 5 AR = $(CROSS_COMPILE)ar
kfraser@11844 6 RANLIB = $(CROSS_COMPILE)ranlib
kfraser@11844 7 NM = $(CROSS_COMPILE)nm
kfraser@11844 8 STRIP = $(CROSS_COMPILE)strip
kfraser@11844 9 OBJCOPY = $(CROSS_COMPILE)objcopy
kfraser@11844 10 OBJDUMP = $(CROSS_COMPILE)objdump
kfraser@11844 11
kaf24@13228 12 MSGFMT = msgfmt
tom@14902 13 MSGMERGE = msgmerge
kaf24@13228 14
kfraser@11844 15 INSTALL = install
kfraser@14314 16 INSTALL_DIR = $(INSTALL) -d -m0755 -p
kfraser@14314 17 INSTALL_DATA = $(INSTALL) -m0644 -p
kfraser@14314 18 INSTALL_PROG = $(INSTALL) -m0755 -p
kfraser@11844 19
keir@16823 20 PREFIX ?= /usr
keir@16826 21 BINDIR = $(PREFIX)/bin
keir@16825 22 INCLUDEDIR = $(PREFIX)/include
keir@16988 23 LIBLEAFDIR = lib
keir@16988 24 LIBLEAFDIR_x86_64 = lib64
keir@16988 25 LIBDIR = $(PREFIX)/$(LIBLEAFDIR)
keir@16988 26 LIBDIR_x86_64 = $(PREFIX)/$(LIBLEAFDIR_x86_64)
keir@16829 27 MANDIR = $(PREFIX)/share/man
keir@16829 28 MAN1DIR = $(MANDIR)/man1
keir@16829 29 MAN8DIR = $(MANDIR)/man8
keir@16828 30 SBINDIR = $(PREFIX)/sbin
kfraser@11844 31
keir@16937 32 PRIVATE_PREFIX = $(LIBDIR)/xen
keir@16937 33 PRIVATE_BINDIR = $(PRIVATE_PREFIX)/bin
keir@16937 34
kfraser@11844 35 SOCKET_LIBS =
kfraser@11844 36 CURSES_LIBS = -lncurses
keir@16117 37 UTIL_LIBS = -lutil
kfraser@11844 38 SONAME_LDFLAG = -soname
kfraser@11844 39 SHLIB_CFLAGS = -shared
kfraser@11844 40
kfraser@11844 41 ifneq ($(debug),y)
kfraser@11844 42 # Optimisation flags are overridable
kfraser@11844 43 CFLAGS ?= -O2 -fomit-frame-pointer
kfraser@11844 44 else
kfraser@11844 45 # Less than -O1 produces bad code and large stack frames
kfraser@11844 46 CFLAGS ?= -O1 -fno-omit-frame-pointer
kfraser@11844 47 endif