debuggers.hg

view tools/libxutil/Makefile @ 3588:a26c121cabd0

bitkeeper revision 1.1159.231.2 (41f8c846X6nmyCraD342rP9SirCaqg)

Merge scramble.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into scramble.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk
author kaf24@scramble.cl.cam.ac.uk
date Thu Jan 27 10:53:58 2005 +0000 (2005-01-27)
parents 93b8d938e316 dca8a77a487d
children 25f3f22927e9 2e60786262c4
line source
1 XEN_ROOT = ../..
2 INSTALL = install
3 INSTALL_DATA = $(INSTALL) -m0644
4 INSTALL_PROG = $(INSTALL) -m0755
5 INSTALL_DIR = $(INSTALL) -d -m0755
7 include $(XEN_ROOT)/tools/Rules.mk
9 CC = gcc
11 LIB_SRCS :=
12 LIB_SRCS += allocate.c
13 LIB_SRCS += enum.c
14 LIB_SRCS += file_stream.c
15 LIB_SRCS += gzip_stream.c
16 LIB_SRCS += hash_table.c
17 LIB_SRCS += iostream.c
18 LIB_SRCS += lexis.c
19 LIB_SRCS += string_stream.c
20 LIB_SRCS += sxpr.c
21 LIB_SRCS += sxpr_parser.c
22 LIB_SRCS += sys_net.c
23 LIB_SRCS += sys_string.c
24 LIB_SRCS += util.c
26 LIB_OBJS := $(LIB_SRCS:.c=.o)
28 CFLAGS += -Wall -Werror -O3 -fno-strict-aliasing
30 # Get gcc to generate the dependencies for us.
31 CFLAGS += -Wp,-MD,.$(@F).d
32 DEPS = .*.d
34 MAJOR := 3.0
35 MINOR := 0
36 LIB_NAME := libxutil
37 LIB := $(LIB_NAME).so
38 LIB += $(LIB_NAME).so.$(MAJOR)
39 LIB += $(LIB_NAME).so.$(MAJOR).$(MINOR)
40 LIB += $(LIB_NAME).a
42 all: check-for-zlib
43 $(MAKE) $(LIB)
45 $(LIB_NAME).so: $(LIB_NAME).so.$(MAJOR)
46 ln -sf $^ $@
48 $(LIB_NAME).so.$(MAJOR): $(LIB_NAME).so.$(MAJOR).$(MINOR)
49 ln -sf $^ $@
51 $(LIB_NAME).so.$(MAJOR).$(MINOR): $(LIB_OBJS)
52 $(CC) -Wl,-soname -Wl,$(LIB_NAME).so.$(MAJOR) -shared -o $@ $^
54 $(LIB_NAME).a: $(LIB_OBJS)
55 $(AR) rc $@ $^
57 check-for-zlib:
58 @if [ ! -e /usr/include/zlib.h ]; then \
59 echo "***********************************************************"; \
60 echo "ERROR: install zlib header files (http://www.gzip.org/zlib)"; \
61 echo "***********************************************************"; \
62 false; \
63 fi
65 install: all
66 $(INSTALL_DIR) -p $(DESTDIR)/usr/lib
67 $(INSTALL_PROG) $(LIB) $(DESTDIR)/usr/lib
68 ln -sf $(LIB_NAME).so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/lib/$(LIB_NAME).so.$(MAJOR)
69 ln -sf $(LIB_NAME).so.$(MAJOR) $(DESTDIR)/usr/lib/$(LIB_NAME).so
71 clean:
72 $(RM) *.a *.so *.so.* *.o *.rpm
73 $(RM) *~
74 $(RM) $(DEPS)
76 -include $(DEPS)