ia64/xen-unstable

view tools/libxutil/Makefile @ 3562:308203ddc173

bitkeeper revision 1.1159.223.48 (41f9204fFDaBv7jCdF63bwx5zXNlNA)

Merge arcadians.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-2.0-testing.bk
into arcadians.cl.cam.ac.uk:/local/scratch-2/cl349/xen-2.0-testing.bk
author cl349@arcadians.cl.cam.ac.uk
date Thu Jan 27 17:09:35 2005 +0000 (2005-01-27)
parents dca8a77a487d 0a8bc30a7c4b
children 2e60786262c4 0c8d62df84ae
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 := 2.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 [ -d $(DESTDIR)/usr/lib ] || $(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)