ia64/xen-unstable

view tools/debugger/libxendebug/Makefile @ 6435:b4b3f6be5226

merge?
author cl349@firebug.cl.cam.ac.uk
date Thu Aug 25 17:27:49 2005 +0000 (2005-08-25)
parents 0610add7c3fe 6e899a3840b2
children 8799d14bef77 9312a3e8a6f8
line source
2 INSTALL = install
3 INSTALL_PROG = $(INSTALL) -m0755
4 INSTALL_DATA = $(INSTALL) -m0644
5 INSTALL_DIR = $(INSTALL) -d -m0755
7 MAJOR = 3.0
8 MINOR = 0
10 CC = gcc
12 XEN_ROOT = ../../..
13 include $(XEN_ROOT)/tools/Rules.mk
15 SRCS := xendebug.c
17 CFLAGS += -Wall -Werror -O3 -fno-strict-aliasing
18 CFLAGS += $(INCLUDES) -I. -I$(XEN_ROOT)/tools/libxc
19 # Get gcc to generate the dependencies for us.
20 CFLAGS += -Wp,-MD,.$(@F).d
21 DEPS = .*.d
23 LDFLAGS += -L$(XEN_ROOT)/tools/libxc -lxenctrl
25 LIB_OBJS := $(patsubst %.c,%.o,$(SRCS))
26 PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS))
28 LIB := libxendebug.a libxendebug.so
29 LIB += libxendebug.so.$(MAJOR) libxendebug.so.$(MAJOR).$(MINOR)
31 all: build
32 build:
33 $(MAKE) $(LIB)
35 install: build
36 [ -d $(DESTDIR)/usr/$(LIBDIR) ] || $(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
37 [ -d $(DESTDIR)/usr/include ] || $(INSTALL_DIR) $(DESTDIR)/usr/include
38 $(INSTALL_PROG) libxendebug.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
39 $(INSTALL_DATA) libxendebug.a $(DESTDIR)/usr/$(LIBDIR)
40 ln -sf libxendebug.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxendebug.so.$(MAJOR)
41 ln -sf libxendebug.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxendebug.so
42 $(INSTALL_DATA) xendebug.h $(DESTDIR)/usr/include
44 .PHONY: TAGS clean rpm install all
46 TAGS:
47 etags -t $(SRCS) *.h
49 clean:
50 rm -rf *.a *.so* *.o *.opic *.rpm $(LIB) *~ $(DEPS) xen
52 rpm: build
53 rm -rf staging
54 mkdir staging
55 mkdir staging/i386
56 rpmbuild --define "staging$$PWD/staging" --define '_builddir.' \
57 --define "_rpmdir$$PWD/staging" -bb rpm.spec
58 mv staging/i386/*.rpm .
59 rm -rf staging
61 libxendebug.a: $(LIB_OBJS)
62 $(AR) rc $@ $^
64 libxendebug.so: libxendebug.so.$(MAJOR)
65 ln -sf $< $@
66 libxendebug.so.$(MAJOR): libxendebug.so.$(MAJOR).$(MINOR)
67 ln -sf $< $@
69 libxendebug.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
70 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxendebug.so.$(MAJOR) -shared -o $@ $^
72 -include $(DEPS)