ia64/xen-unstable

view tools/xc/lib/Makefile @ 962:57093982ce20

bitkeeper revision 1.617 (3fbcbdd00Q1Ui884abv72p6z6qttuA)

Makefile:
bug fix
author smh22@labyrinth.cl.cam.ac.uk
date Thu Nov 20 13:12:48 2003 +0000 (2003-11-20)
parents 31e50e01f987
children 895f1ca085a7
line source
2 CC = gcc
3 CFLAGS = -c -Wall -O3
4 CFLAGS += -I../../../xen/include -I../../../xenolinux-sparse/include
6 HDRS = $(wildcard *.h)
7 OBJS = $(patsubst %.c,%.o,$(wildcard libxc_*.c))
9 LIBS = libxc.a libxc.so
11 all: check-for-zlib $(LIBS)
12 ranlib libxc.a
14 check-for-zlib:
15 @if [ ! -e /usr/include/zlib.h ]; then \
16 echo "***********************************************************"; \
17 echo "ERROR: install zlib header files (http://www.gzip.org/zlib)"; \
18 echo "***********************************************************"; \
19 false; \
20 fi
22 install: all
23 mkdir -p ../../../../install/lib
24 mkdir -p ../../../../install/include
25 cp -a $(LIBS) ../../../../install/lib
26 for i in $(LIBS); do chmod 755 ../../../../install/bin/$i ; done
27 cp -a xc.h ../../../../install/include
28 chmod 644 ../../../../install/include/xc.h
30 clean:
31 $(RM) *.a *.so *.o *.rpm $(LIBS)
33 rpm: all
34 rm -rf staging
35 mkdir staging
36 mkdir staging/i386
37 rpmbuild --define "staging$$PWD/staging" --define '_builddir.' \
38 --define "_rpmdir$$PWD/staging" -bb rpm.spec
39 mv staging/i386/*.rpm .
40 rm -rf staging
42 libxc.so: $(OBJS)
43 $(LD) -shared -o $@ $^ -lz
45 libxc.a: libxc.a($(OBJS))
47 %.o: %.c $(HDRS) Makefile
48 $(CC) $(CFLAGS) -o $@ $<