ia64/xen-unstable

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