debuggers.hg

view tools/libxutil/Makefile @ 3699:09723a1de726

bitkeeper revision 1.1159.212.92 (4204921aEJqAV7p8MQEa98S3OLscXg)

Merge freefall.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-2.0-testing.bk
into freefall.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-unstable.bk
author iap10@freefall.cl.cam.ac.uk
date Sat Feb 05 09:30:02 2005 +0000 (2005-02-05)
parents c3c66a2762cb f9b3b23cf5ff
children 5039176029e8
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/Rules.mk
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)
27 LIB_PIC_OBJS := $(LIB_SRCS:.c=.opic)
29 CFLAGS += -Wall -Werror -O3 -fno-strict-aliasing
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_NAME := libxutil
38 SO_NAME := $(LIB_NAME).so.$(MAJOR)
39 LIB := $(LIB_NAME).so
40 LIB += $(LIB_NAME).so.$(MAJOR)
41 LIB += $(LIB_NAME).so.$(MAJOR).$(MINOR)
42 LIB += $(LIB_NAME).a
44 all: check-for-zlib
45 $(MAKE) $(LIB)
47 $(LIB_PIC_OBJS): %.opic: %.c
48 $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $<
50 $(LIB_NAME).so: $(LIB_NAME).so.$(MAJOR)
51 ln -sf $^ $@
53 $(LIB_NAME).so.$(MAJOR): $(LIB_NAME).so.$(MAJOR).$(MINOR)
54 ln -sf $^ $@
56 $(LIB_NAME).so.$(MAJOR).$(MINOR): $(LIB_PIC_OBJS)
57 $(CC) -Wl,-soname -Wl,$(SO_NAME) -shared -o $@ $^
59 $(LIB_NAME).a: $(LIB_OBJS)
60 $(AR) rc $@ $^
62 check-for-zlib:
63 @if [ ! -e /usr/include/zlib.h ]; then \
64 echo "***********************************************************"; \
65 echo "ERROR: install zlib header files (http://www.gzip.org/zlib)"; \
66 echo "***********************************************************"; \
67 false; \
68 fi
70 install: all
71 [ -d $(DESTDIR)/usr/lib ] || $(INSTALL_DIR) -p $(DESTDIR)/usr/lib
72 $(INSTALL_PROG) $(LIB_NAME).so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/lib
73 $(INSTALL_DATA) $(LIB_NAME).a $(DESTDIR)/usr/lib
74 ln -sf $(LIB_NAME).so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/lib/$(LIB_NAME).so.$(MAJOR)
75 ln -sf $(LIB_NAME).so.$(MAJOR) $(DESTDIR)/usr/lib/$(LIB_NAME).so
77 clean:
78 $(RM) *.a *.so *.so.* *.o *.opic *.rpm
79 $(RM) *~
80 $(RM) $(DEPS)
82 -include $(DEPS)