ia64/xen-unstable

view tools/libxutil/Makefile @ 3539:93b8d938e316

bitkeeper revision 1.1159.212.42 (41f6790d_JgecZcMdZzpMtjaR5vjUg)

Upgrade library version numbers.
author kaf24@scramble.cl.cam.ac.uk
date Tue Jan 25 16:51:25 2005 +0000 (2005-01-25)
parents f7ab8a19799b
children d8ba911dce48 a26c121cabd0 30ee9c427a5b
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/Make.defs
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)