ia64/xen-unstable

view tools/vnet/libxutil/Makefile @ 6766:219d96d545fc

merge?
author cl349@firebug.cl.cam.ac.uk
date Mon Sep 12 20:00:41 2005 +0000 (2005-09-12)
parents dd668f7527cb
children b2f4823b6ff0 b35215021b32 9af349b055e5 3233e7ecfa9f
line source
1 ifndef VNET_ROOT
2 export VNET_ROOT = $(shell cd .. && pwd)
3 include $(VNET_ROOT)/Make.env
4 endif
6 INSTALL = install
7 INSTALL_DATA = $(INSTALL) -m0644
8 INSTALL_PROG = $(INSTALL) -m0755
9 INSTALL_DIR = $(INSTALL) -d -m0755
11 include $(XEN_ROOT)/tools/Rules.mk
13 LIB_SRCS :=
14 LIB_SRCS += allocate.c
15 LIB_SRCS += enum.c
16 LIB_SRCS += file_stream.c
17 LIB_SRCS += gzip_stream.c
18 LIB_SRCS += hash_table.c
19 LIB_SRCS += iostream.c
20 LIB_SRCS += lexis.c
21 LIB_SRCS += mem_stream.c
22 LIB_SRCS += string_stream.c
23 LIB_SRCS += sxpr.c
24 LIB_SRCS += sxpr_parser.c
25 LIB_SRCS += sys_net.c
26 LIB_SRCS += sys_string.c
27 LIB_SRCS += util.c
29 LIB_OBJS := $(LIB_SRCS:.c=.o)
30 PIC_OBJS := $(LIB_SRCS:.c=.opic)
32 CFLAGS += -Wall -Werror -O3 -fno-strict-aliasing
33 CFLAGS += -g
35 # Get gcc to generate the dependencies for us.
36 CFLAGS += -Wp,-MD,.$(@F).d
37 DEPS = .*.d
39 MAJOR := 3.0
40 MINOR := 0
41 LIB := libxutil.so
42 LIB += libxutil.so.$(MAJOR)
43 LIB += libxutil.so.$(MAJOR).$(MINOR)
44 LIB += libxutil.a
46 all: build
48 build: check-for-zlib
49 $(MAKE) $(LIB)
51 libxutil.so: libxutil.so.$(MAJOR)
52 ln -sf $^ $@
54 libxutil.so.$(MAJOR): libxutil.so.$(MAJOR).$(MINOR)
55 ln -sf $^ $@
57 libxutil.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
58 $(CC) $(CFLAGS) -Wl,-soname -Wl,libxutil.so.$(MAJOR) -shared -o $@ $^
60 libxutil.a: $(LIB_OBJS)
61 $(AR) rc $@ $^
63 check-for-zlib:
64 @if [ ! -e /usr/include/zlib.h ]; then \
65 echo "***********************************************************"; \
66 echo "ERROR: install zlib header files (http://www.gzip.org/zlib)"; \
67 echo "***********************************************************"; \
68 false; \
69 fi
71 install: build
72 [ -d $(DESTDIR)/usr/$(LIBDIR) ] || $(INSTALL_DIR) -p $(DESTDIR)/usr/$(LIBDIR)
73 $(INSTALL_PROG) libxutil.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
74 $(INSTALL_DATA) libxutil.a $(DESTDIR)/usr/$(LIBDIR)
75 ln -sf libxutil.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxutil.so.$(MAJOR)
76 ln -sf libxutil.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxutil.so
78 clean:
79 -@$(RM) *.a *.so* *.o *.opic *.rpm
80 -@$(RM) *~
81 -@$(RM) $(DEPS)
83 -include $(DEPS)