debuggers.hg

view tools/vnet/libxutil/Makefile @ 0:7d21f7218375

Exact replica of unstable on 051908 + README-this
author Mukesh Rathor
date Mon May 19 15:34:57 2008 -0700 (2008-05-19)
parents
children 46f8fc57b1a4
line source
1 ifndef VNET_ROOT
2 export VNET_ROOT = $(shell cd .. && pwd)
3 include $(VNET_ROOT)/Make.env
4 endif
6 include $(XEN_ROOT)/tools/Rules.mk
8 LIB_SRCS :=
9 LIB_SRCS += allocate.c
10 LIB_SRCS += enum.c
11 LIB_SRCS += file_stream.c
12 #LIB_SRCS += gzip_stream.c
13 LIB_SRCS += hash_table.c
14 LIB_SRCS += iostream.c
15 LIB_SRCS += lexis.c
16 LIB_SRCS += mem_stream.c
17 LIB_SRCS += string_stream.c
18 LIB_SRCS += sxpr.c
19 LIB_SRCS += sxpr_parser.c
20 LIB_SRCS += sys_net.c
21 LIB_SRCS += sys_string.c
22 LIB_SRCS += util.c
24 LIB_OBJS := $(LIB_SRCS:.c=.o)
25 PIC_OBJS := $(LIB_SRCS:.c=.opic)
27 CFLAGS += -Werror -fno-strict-aliasing $(call cc-option,$(CC),-fgnu89-inline,)
28 CFLAGS += -O3
29 #CFLAGS += -g
31 # Get gcc to generate the dependencies for us.
32 CFLAGS += -Wp,-MD,.$(@F).d
33 DEPS = .*.d
35 MAJOR := 3.0
36 MINOR := 0
37 LIB := libxutil.so
38 LIB += libxutil.so.$(MAJOR)
39 LIB += libxutil.so.$(MAJOR).$(MINOR)
40 LIB += libxutil.a
42 .PHONY: all
43 all: build
45 .PHONY: build
46 build: #check-for-zlib
47 $(MAKE) $(LIB)
49 gzip_stream.o: check-for-zlib
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_LDFLAG) -Wl,libxutil.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^
60 libxutil.a: $(LIB_OBJS)
61 $(AR) rc $@ $^
63 .PHONY: check-for-zlib
64 check-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
72 .PHONY: install
73 install: build
74 $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
75 $(INSTALL_PROG) libxutil.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
76 $(INSTALL_DATA) libxutil.a $(DESTDIR)$(LIBDIR)
77 ln -sf libxutil.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxutil.so.$(MAJOR)
78 ln -sf libxutil.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxutil.so
80 .PHONY: clean
81 clean:
82 -@$(RM) *.a *.so* *.o *.opic *.rpm
83 -@$(RM) *~
84 -@$(RM) $(DEPS)
86 -include $(DEPS)