ia64/xen-unstable

changeset 1182:f4acf782671a

bitkeeper revision 1.797 (4055c521Ophk9zIrp59mxPKyKg_0MA)

Makefile:
Rationalise makefiles by folding dist option into install with a prefined prefix.
author kaf24@scramble.cl.cam.ac.uk
date Mon Mar 15 15:00:49 2004 +0000 (2004-03-15)
parents fe871cc66b5a
children c5f71f50a168
files Makefile tools/Makefile tools/balloon/Makefile tools/examples/Makefile tools/misc/Makefile tools/misc/miniterm/Makefile tools/nsplitd/Makefile tools/xc/Makefile tools/xc/lib/Makefile tools/xc/py/Makefile tools/xend/Makefile tools/xentrace/Makefile xen/Makefile xenolinux-2.4.25-sparse/arch/xeno/Makefile
line diff
     1.1 --- a/Makefile	Mon Mar 15 13:20:33 2004 +0000
     1.2 +++ b/Makefile	Mon Mar 15 15:00:49 2004 +0000
     1.3 @@ -19,8 +19,8 @@ install: all
     1.4  	$(MAKE) -C tools install
     1.5  
     1.6  dist: all
     1.7 -	$(MAKE) -C xen dist
     1.8 -	$(MAKE) -C tools dist
     1.9 +	$(MAKE) prefix=`pwd`/../install -C xen install
    1.10 +	$(MAKE) prefix=`pwd`/../install -C tools install
    1.11  
    1.12  clean:
    1.13  	$(MAKE) -C xen clean
     2.1 --- a/tools/Makefile	Mon Mar 15 13:20:33 2004 +0000
     2.2 +++ b/tools/Makefile	Mon Mar 15 15:00:49 2004 +0000
     2.3 @@ -33,14 +33,6 @@ install: all
     2.4  	$(MAKE) -C xentrace install
     2.5  	$(MAKE) -C xend install
     2.6  
     2.7 -dist: all
     2.8 -	$(MAKE) -C balloon dist
     2.9 -	$(MAKE) -C xc dist
    2.10 -	$(MAKE) -C misc dist
    2.11 -	$(MAKE) -C examples dist
    2.12 -	$(MAKE) -C xentrace dist
    2.13 -	$(MAKE) -C xend dist
    2.14 -
    2.15  clean:
    2.16  	$(MAKE) -C balloon clean
    2.17  	$(MAKE) -C xc clean
     3.1 --- a/tools/balloon/Makefile	Mon Mar 15 13:20:33 2004 +0000
     3.2 +++ b/tools/balloon/Makefile	Mon Mar 15 15:00:49 2004 +0000
     3.3 @@ -1,17 +1,13 @@
     3.4 -CC = gcc
     3.5 -TARGET=balloon
     3.6  
     3.7 -$(TARGET): balloon.c
     3.8 -	$(CC) -O2 -Wall -o $(TARGET) balloon.c
     3.9 +CC     = gcc
    3.10 +CFLAGS = -Wall -O3
    3.11 +TARGET = balloon
    3.12  
    3.13 -install: $(TARGET)
    3.14 -	mkdir -p $(prefix)/usr/bin
    3.15 -	cp -a $(TARGET) $(prefix)/usr/bin
    3.16 +all: $(TARGET)
    3.17  
    3.18 -dist: $(TARGET)
    3.19 -	mkdir -p ../../../install/bin
    3.20 -	cp -a $(TARGET) ../../../install/bin
    3.21 +install: all
    3.22 +	mkdir -p $(prefix)/usr/bin
    3.23 +	install -m0755 $(TARGET) $(prefix)/usr/bin
    3.24  
    3.25  clean:
    3.26  	$(RM) *.o $(TARGET) *~
    3.27 -
     4.1 --- a/tools/examples/Makefile	Mon Mar 15 13:20:33 2004 +0000
     4.2 +++ b/tools/examples/Makefile	Mon Mar 15 15:00:49 2004 +0000
     4.3 @@ -7,20 +7,11 @@ all:
     4.4  
     4.5  install: all
     4.6  	mkdir -p $(prefix)/usr/bin
     4.7 -	cp -a $(INSTALL) $(prefix)/usr/bin
     4.8 -	#chmod 755 $(INSTALL)
     4.9  	mkdir -p $(prefix)/etc/xc
    4.10 -	for i in $(ETC) ; do [ ! -e $(prefix)/etc/xc/$$i ] && echo Install $$i && cp $$i $(prefix)/etc/xc/ ; done || true
    4.11  	mkdir -p $(prefix)/etc/xc/auto
    4.12 -	for i in $(INITD) ; do [ -e $(prefix)/etc/init.d/ ] && [ ! -e $(prefix)/etc/init.d/$$i ] && cp $$i $(prefix)/etc/init.d/ ; done || true
    4.13 -
    4.14 -dist: all
    4.15 -	mkdir -p ../../../install/bin
    4.16 -	mkdir -p ../../../install/etc
    4.17 -	mkdir -p ../../../install/init.d
    4.18 -	install --mode=555 $(INSTALL) ../../../install/bin
    4.19 -	install --mode=444 $(ETC) ../../../install/etc
    4.20 -	#chmod 755 $(INSTALL)
    4.21 -	install --mode=555 $(INITD) ../../../install/init.d
    4.22 +	mkdir -p $(prefix)/etc/init.d
    4.23 +	install -m0755 $(INSTALL) $(prefix)/usr/bin
    4.24 +	install -m0644 $(ETC) $(prefix)/etc/xc
    4.25 +	install -m0755 $(INITD) $(prefix)/etc/init.d
    4.26  
    4.27  clean:
     5.1 --- a/tools/misc/Makefile	Mon Mar 15 13:20:33 2004 +0000
     5.2 +++ b/tools/misc/Makefile	Mon Mar 15 15:00:49 2004 +0000
     5.3 @@ -1,3 +1,4 @@
     5.4 +
     5.5  CC         = gcc
     5.6  CFLAGS     = -Wall -O3 
     5.7  EXTRA_INC  = -I../../xen/include/hypervisor-ifs
     5.8 @@ -12,24 +13,16 @@ TARGETS  = xen_cpuperf
     5.9  INSTALL  = $(TARGETS) xen-mkdevnodes xen_nat_enable xen-clone 
    5.10  
    5.11  all: $(TARGETS)
    5.12 -	$(MAKE) -C miniterm	
    5.13 +	$(MAKE) -C miniterm
    5.14  
    5.15  install: all
    5.16  	mkdir -p $(prefix)/usr/bin
    5.17 -	cp $(INSTALL) $(prefix)/usr/bin
    5.18 -	for i in $(INSTALL); do chmod 755 $(prefix)/usr/bin/$i ; done
    5.19 +	install -m0755 $(INSTALL) $(prefix)/usr/bin
    5.20  	$(MAKE) -C miniterm install
    5.21  
    5.22 -dist: all
    5.23 -	mkdir -p ../../../install/bin
    5.24 -	cp $(INSTALL) ../../../install/bin
    5.25 -	for i in $(INSTALL); do chmod 755 ../../../install/bin/$i ; done
    5.26 -	$(MAKE) -C miniterm dist
    5.27 -
    5.28  clean:
    5.29 -	$(RM) *.o $(TARGETS)
    5.30 +	$(RM) *.o $(TARGETS) *~
    5.31  	$(MAKE) -C miniterm clean	
    5.32  
    5.33  %: %.c $(HDRS) Makefile
    5.34  	$(CC) $(CFLAGS) $(EXTRA_INC) -o $@ $<
    5.35 -
     6.1 --- a/tools/misc/miniterm/Makefile	Mon Mar 15 13:20:33 2004 +0000
     6.2 +++ b/tools/misc/miniterm/Makefile	Mon Mar 15 15:00:49 2004 +0000
     6.3 @@ -1,13 +1,13 @@
     6.4 -CC      = gcc
     6.5 -CFLAGS  = -O3 -march=i686 -Wall
     6.6  
     6.7 -all: miniterm
     6.8 +CC     = gcc
     6.9 +CFLAGS = -Wall -O3
    6.10 +TARGET = miniterm
    6.11 +
    6.12 +all: $(TARGET)
    6.13  
    6.14  install: all
    6.15 -	cp -a miniterm $(prefix)/usr/bin/	
    6.16 -
    6.17 -dist: all
    6.18 -	cp -a miniterm ../../../../install/bin/	
    6.19 +	mkdir -p $(prefix)/usr/bin
    6.20 +	install -m0755 $(TARGET) $(prefix)/usr/bin
    6.21  
    6.22  clean:
    6.23 -	rm -f *.o miniterm *~
    6.24 +	$(RM) *.o $(TARGET) *~
     7.1 --- a/tools/nsplitd/Makefile	Mon Mar 15 13:20:33 2004 +0000
     7.2 +++ b/tools/nsplitd/Makefile	Mon Mar 15 15:00:49 2004 +0000
     7.3 @@ -1,25 +1,22 @@
     7.4  
     7.5 -CC       = gcc
     7.6 -CFLAGS  = -Wall -g -O3
     7.7 -CFILES	= $(wildcard *.c)
     7.8 +CC     = gcc
     7.9 +CFLAGS = -Wall -O3
    7.10 +CFILES = $(wildcard *.c)
    7.11  
    7.12  HDRS     = $(wildcard *.h)
    7.13  OBJS     = $(patsubst %.c,%.o,$(wildcard *.c))
    7.14  
    7.15 -INSTALL_BINS := nsplitd
    7.16 +TARGET   = nsplitd
    7.17  
    7.18 -all: nsplitd
    7.19 -
    7.20 -nsplitd: $(OBJS)
    7.21 -	$(CC) $(CFLAGS) -o nsplitd $(OBJS)
    7.22 +all: $(TARGET)
    7.23  
    7.24  install: all
    7.25  
    7.26 -dist: all
    7.27 +clean:
    7.28 +	$(RM) *.o $(TARGET) *~
    7.29  
    7.30 -clean:
    7.31 -	$(RM) *.o $(INSTALL_BINS)
    7.32 -
    7.33 +$(TARGET): $(OBJS)
    7.34 +	$(CC) $(CFLAGS) -o $@ $^
    7.35  
    7.36  %.o: %.c $(HDRS) Makefile
    7.37  	$(CC) $(CFLAGS) -c -o $@ $<
     8.1 --- a/tools/xc/Makefile	Mon Mar 15 13:20:33 2004 +0000
     8.2 +++ b/tools/xc/Makefile	Mon Mar 15 15:00:49 2004 +0000
     8.3 @@ -7,10 +7,6 @@ install: all
     8.4  	$(MAKE) -C lib install
     8.5  	$(MAKE) -C py  install
     8.6  
     8.7 -dist: all
     8.8 -	$(MAKE) -C lib dist
     8.9 -	$(MAKE) -C py  dist
    8.10 -
    8.11  clean:
    8.12  	$(MAKE) -C lib clean
    8.13  	$(MAKE) -C py  clean
     9.1 --- a/tools/xc/lib/Makefile	Mon Mar 15 13:20:33 2004 +0000
     9.2 +++ b/tools/xc/lib/Makefile	Mon Mar 15 15:00:49 2004 +0000
     9.3 @@ -26,18 +26,8 @@ check-for-zlib:
     9.4  install: all
     9.5  	mkdir -p $(prefix)/usr/lib
     9.6  	mkdir -p $(prefix)/usr/include
     9.7 -	cp -a $(LIB) $(prefix)/usr/lib
     9.8 -	chmod 755 $(prefix)/usr/lib/$(LIB)
     9.9 -	cp xc.h $(prefix)/usr/include
    9.10 -	chmod 644 $(prefix)/usr/include/xc.h
    9.11 -
    9.12 -dist: all
    9.13 -	mkdir -p ../../../../install/lib
    9.14 -	mkdir -p ../../../../install/include
    9.15 -	cp -a $(LIB) ../../../../install/lib
    9.16 -	chmod 755 ../../../../install/lib/$(LIB)
    9.17 -	cp xc.h ../../../../install/include
    9.18 -	chmod 644 ../../../../install/include/xc.h
    9.19 +	install -m0755 $(LIB) $(prefix)/usr/lib
    9.20 +	install -m0644 xc.h $(prefix)/usr/include
    9.21  
    9.22  clean:
    9.23  	$(RM) *.a *.so *.o *.rpm $(LIB)
    10.1 --- a/tools/xc/py/Makefile	Mon Mar 15 13:20:33 2004 +0000
    10.2 +++ b/tools/xc/py/Makefile	Mon Mar 15 15:00:49 2004 +0000
    10.3 @@ -4,15 +4,7 @@ all:
    10.4  
    10.5  install: all
    10.6  	if [ "$(prefix)" = "" ]; then python setup.py install; \
    10.7 -	else python setup.py install --root "$(prefix)"; fi
    10.8 +	else python setup.py install --home="$(prefix)"; fi
    10.9  
   10.10 -dist: all
   10.11 -	mkdir -p ../../../../install/lib/python
   10.12 -	for i in `find . -name 'Xc.so'` ; do                           \
   10.13 -		install --mode=755 $$i ../../../../install/lib/python/`basename $$i` ; \
   10.14 -	done
   10.15 -	python -c 'import py_compile, sys; py_compile.compile("XenoUtil.py")'
   10.16 -	install --mode=444 XenoUtil.py ../../../../install/lib/python
   10.17 -	install --mode=644 XenoUtil.pyc ../../../../install/lib/python
   10.18  clean:
   10.19  	rm -rf build *.pyc *.pyo *.o *.a *~
    11.1 --- a/tools/xend/Makefile	Mon Mar 15 13:20:33 2004 +0000
    11.2 +++ b/tools/xend/Makefile	Mon Mar 15 15:00:49 2004 +0000
    11.3 @@ -4,22 +4,9 @@ all:
    11.4  
    11.5  install: all
    11.6  	if [ "$(prefix)" = "" ]; then python setup.py install; \
    11.7 -	else python setup.py install --root "$(prefix)"; fi
    11.8 -	install --mode=755 xend $(prefix)/usr/sbin
    11.9 -
   11.10 -dist: all
   11.11 -	mkdir -p ../../../../install/lib/python
   11.12 -	for i in `find . -name 'xend_utils.so'` ; do           \
   11.13 -		install --mode=755 $$i ../../../../install/lib/python/`basename $$i` ; \
   11.14 -	done
   11.15 -	python -c 'import py_compile, sys; py_compile.compile("XenoUtil.py")'
   11.16 -	install --mode=755 xend ../../../../install/sbin
   11.17 +	else python setup.py install --home="$(prefix)"; fi
   11.18 +	mkdir -p $(prefix)/usr/sbin
   11.19 +	install -m0755 xend $(prefix)/usr/sbin
   11.20  
   11.21  clean:
   11.22  	rm -rf build *.pyc *.pyo *.a *.so *.o *~ *.rpm 
   11.23 -
   11.24 -$(BIN): $(OBJS)
   11.25 -	$(CC) -o $@ $^ -L../xc/lib -lxc
   11.26 -
   11.27 -%.o: %.c $(HDRS) Makefile
   11.28 -	$(CC) $(CFLAGS) -c -o $@ $<
    12.1 --- a/tools/xentrace/Makefile	Mon Mar 15 13:20:33 2004 +0000
    12.2 +++ b/tools/xentrace/Makefile	Mon Mar 15 15:00:49 2004 +0000
    12.3 @@ -17,19 +17,9 @@ install: all
    12.4  	mkdir -p $(prefix)/usr/bin
    12.5  	mkdir -p $(prefix)/usr/man/man1
    12.6  	mkdir -p $(prefix)/usr/man/man8
    12.7 -	cp $(BIN) $(prefix)/usr/bin
    12.8 -	for i in $(BIN); do chmod 755 $(prefix)/usr/bin/$$i; done
    12.9 -	for i in $(MAN1); do cp $$i $(prefix)/usr/man/man1/$$i; done
   12.10 -	for i in $(MAN8); do cp $$i $(prefix)/usr/man/man8/$$i; done
   12.11 -
   12.12 -dist: all
   12.13 -	mkdir -p ../../../install/bin
   12.14 -	mkdir -p ../../../install/man/man1
   12.15 -	mkdir -p ../../../install/man/man8
   12.16 -	cp $(BIN) ../../../install/bin
   12.17 -	for i in $(BIN); do chmod 755 ../../../install/bin/$$i; done
   12.18 -	for i in $(MAN1); do cp $$i ../../../install/man/man1/$$i; done
   12.19 -	for i in $(MAN8); do cp $$i ../../../install/man/man8/$$i; done
   12.20 +	install -m0755 $(BIN) $(prefix)/usr/bin
   12.21 +	install -m0644 $(MAN1) $(prefix)/usr/man/man1
   12.22 +	install -m0644 $(MAN8) $(prefix)/usr/man/man8
   12.23  
   12.24  clean:
   12.25  	$(RM) *.a *.so *.o *.rpm $(BIN)
    13.1 --- a/xen/Makefile	Mon Mar 15 13:20:33 2004 +0000
    13.2 +++ b/xen/Makefile	Mon Mar 15 15:00:49 2004 +0000
    13.3 @@ -20,12 +20,7 @@ debug:
    13.4  install: $(TARGET)
    13.5  	gzip -f -9 < $(TARGET) > $(TARGET).gz
    13.6  	mkdir -p $(prefix)/boot
    13.7 -	cp -a $(TARGET).gz $(prefix)/boot
    13.8 -
    13.9 -dist: $(TARGET)
   13.10 -	gzip -f -9 < $(TARGET) > $(TARGET).gz
   13.11 -	mkdir -p ../../install/boot
   13.12 -	cp -a $(TARGET).gz ../../install/boot/
   13.13 +	install -m0644 $(TARGET).gz $(prefix)/boot
   13.14  
   13.15  clean: delete-links
   13.16  	$(MAKE) -C tools clean
    14.1 --- a/xenolinux-2.4.25-sparse/arch/xeno/Makefile	Mon Mar 15 13:20:33 2004 +0000
    14.2 +++ b/xenolinux-2.4.25-sparse/arch/xeno/Makefile	Mon Mar 15 15:00:49 2004 +0000
    14.3 @@ -100,12 +100,12 @@ bzImage: vmlinux
    14.4  	@$(MAKEBOOT) xenolinux.gz
    14.5  
    14.6  install: bzImage
    14.7 -	mkdir -p /boot
    14.8 -	cp -a arch/$(ARCH)/boot/xenolinux.gz /boot/xenolinux.gz
    14.9 +	mkdir -p $(prefix)/boot
   14.10 +	install -m0644 arch/$(ARCH)/boot/xenolinux.gz $(prefix)/boot/xenolinux.gz
   14.11  
   14.12  dist: bzImage
   14.13  	mkdir -p ../install/boot
   14.14 -	cp -a arch/$(ARCH)/boot/xenolinux.gz ../install/boot/xenolinux.gz
   14.15 +	install -m0644 arch/$(ARCH)/boot/xenolinux.gz ../install/boot/xenolinux.gz
   14.16  
   14.17  archclean:
   14.18  	@$(MAKEBOOT) clean