source: trunk/packages/xen-3.1/xen-3.1/tools/vnet/libxutil/Makefile @ 34

Last change on this file since 34 was 34, checked in by hartmans, 18 years ago

Add xen and xen-common

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