aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2005-02-24 08:59:56 +0000
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2005-02-24 08:59:56 +0000
commit71ebe65bbc592ee65306d84ffc1287ad92d10283 (patch)
treee9828ba3186195fc8b1c47fb9fe0316d648b58ce
parent594ca1303769fb8096a0eafdf7b14ef8116d870a (diff)
downloadxen-71ebe65bbc592ee65306d84ffc1287ad92d10283.tar.gz
xen-71ebe65bbc592ee65306d84ffc1287ad92d10283.tar.bz2
xen-71ebe65bbc592ee65306d84ffc1287ad92d10283.zip
bitkeeper revision 1.1159.258.9 (421d978cixdcn2ycn94dJci5cqGzjg)
Build cleanups. Build dynamic libs as -fPIC always. Signed-off-by: Keir Fraser <keir.fraser@cl.cam.ac.uk>
-rw-r--r--tools/Makefile1
-rw-r--r--tools/Rules.mk9
-rw-r--r--tools/libxc/Makefile16
-rw-r--r--tools/libxutil/Makefile16
-rw-r--r--tools/misc/miniterm/Makefile3
-rw-r--r--xen/Makefile4
6 files changed, 15 insertions, 34 deletions
diff --git a/tools/Makefile b/tools/Makefile
index 907260707b..0140f8baae 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -21,6 +21,7 @@ install:
$(MAKE) -C sv install
clean:
+ $(MAKE) -C check clean
$(MAKE) -C libxutil clean
$(MAKE) -C libxc clean
$(MAKE) -C misc clean
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 2666f43842..eb89b3be05 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -4,6 +4,9 @@ XEN_XC = $(XEN_ROOT)/tools/python/xen/lowlevel/xc
XEN_LIBXC = $(XEN_ROOT)/tools/libxc
XEN_LIBXUTIL = $(XEN_ROOT)/tools/libxutil
+COMPILE_ARCH ?= $(shell uname -m | sed -e s/i.86/x86_32/)
+TARGET_ARCH ?= $(COMPILE_ARCH)
+
ifeq ($(TARGET_ARCH),x86_32)
CFLAGS += -m32 -march=i686
LDFLAGS += -m elf_i386
@@ -13,3 +16,9 @@ ifeq ($(TARGET_ARCH),x86_64)
CFLAGS += -m64
LDFLAGS += -m elf_x86_64
endif
+
+%.opic: %.c
+ $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $<
+
+%.o: %.c
+ $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 770b400326..01fd926cf4 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -1,12 +1,4 @@
-ifndef BUILD_PIC_LIBS
-ifeq ($(wildcard /etc/debian_version),)
-BUILD_PIC_LIBS=n
-else
-BUILD_PIC_LIBS=y
-endif
-endif
-
INSTALL = install
INSTALL_PROG = $(INSTALL) -m0755
INSTALL_DATA = $(INSTALL) -m0644
@@ -95,9 +87,6 @@ rpm: all
mv staging/i386/*.rpm .
rm -rf staging
-$(PIC_OBJS): %.opic: %.c
- $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $<
-
libxc.a: $(OBJS)
$(AR) rc $@ $^
@@ -106,12 +95,7 @@ libxc.so: libxc.so.$(MAJOR)
libxc.so.$(MAJOR): libxc.so.$(MAJOR).$(MINOR)
ln -sf $< $@
-ifeq ($(BUILD_PIC_LIBS),y)
libxc.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
$(CC) -Wl,-soname -Wl,libxc.so.$(MAJOR) -shared -o $@ $^ -L../libxutil -lxutil -lz
-else
-libxc.so.$(MAJOR).$(MINOR): $(LIB_OBJS)
- $(CC) -Wl,-soname -Wl,libxc.so.$(MAJOR) -shared -o $@ $^ -L../libxutil -lxutil -lz
-endif
-include $(DEPS)
diff --git a/tools/libxutil/Makefile b/tools/libxutil/Makefile
index 595cd97e83..a9be3e3977 100644
--- a/tools/libxutil/Makefile
+++ b/tools/libxutil/Makefile
@@ -1,12 +1,4 @@
-ifndef BUILD_PIC_LIBS
-ifeq ($(wildcard /etc/debian_version),)
-BUILD_PIC_LIBS=n
-else
-BUILD_PIC_LIBS=y
-endif
-endif
-
XEN_ROOT = ../..
INSTALL = install
INSTALL_DATA = $(INSTALL) -m0644
@@ -51,22 +43,14 @@ LIB += libxutil.a
all: check-for-zlib
$(MAKE) $(LIB)
-$(PIC_OBJS): %.opic: %.c
- $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $<
-
libxutil.so: libxutil.so.$(MAJOR)
ln -sf $^ $@
libxutil.so.$(MAJOR): libxutil.so.$(MAJOR).$(MINOR)
ln -sf $^ $@
-ifeq ($(BUILD_PIC_LIBS),y)
libxutil.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
$(CC) -Wl,-soname -Wl,libxutil.so.$(MAJOR) -shared -o $@ $^
-else
-libxutil.so.$(MAJOR).$(MINOR): $(LIB_OBJS)
- $(CC) -Wl,-soname -Wl,libxutil.so.$(MAJOR) -shared -o $@ $^
-endif
libxutil.a: $(LIB_OBJS)
$(AR) rc $@ $^
diff --git a/tools/misc/miniterm/Makefile b/tools/misc/miniterm/Makefile
index 4051eb61de..a9ae844e84 100644
--- a/tools/misc/miniterm/Makefile
+++ b/tools/misc/miniterm/Makefile
@@ -14,3 +14,6 @@ install: all
clean:
$(RM) *.o $(TARGET) *~
+
+$(TARGET): $(TARGET).c
+ $(CC) $(CFLAGS) -o $@ $<
diff --git a/xen/Makefile b/xen/Makefile
index 57a89ad454..27b5c2e239 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -37,12 +37,12 @@ install: $(TARGET).gz
$(INSTALL_DATA) include/public/io/*.h $(DESTDIR)/usr/include/xen/io
$(INSTALL_DATA) include/public/COPYING $(DESTDIR)/usr/include/xen
-clean:
+clean: delete-unfresh-files
$(MAKE) -C tools clean
$(MAKE) -C common clean
$(MAKE) -C drivers clean
$(MAKE) -C arch/$(TARGET_ARCH) clean
- rm -f include/asm *.o $(TARGET)* *~ core include/xen/compile.h
+ rm -f include/asm *.o $(TARGET)* *~ core
rm -f include/asm-*/asm-offsets.h
rm -f tools/figlet/*.o tools/figlet/figlet