ia64/xen-unstable

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