ia64/xen-unstable

view extras/mini-os/Makefile @ 7238:971e7c7411b3

Raise an exception if an error appears on the pipes to our children, and make
sure that the child's pipes are closed even under that exception. Move the
handling of POLLHUP to the end of the loop, so that we guarantee to read any
remaining data from the child if POLLHUP and POLLIN appear at the same time.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@ewan
date Thu Oct 06 10:13:11 2005 +0100 (2005-10-06)
parents 06d84bf87159
children c176d2e45117
line source
1 debug ?= y
3 include $(CURDIR)/../../Config.mk
5 # Set TARGET_ARCH
6 override TARGET_ARCH := $(XEN_TARGET_ARCH)
8 # NB. '-Wcast-qual' is nasty, so I omitted it.
9 CFLAGS := -fno-builtin -Wall -Werror -Iinclude/ -Wredundant-decls -Wno-format
10 CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
12 ifeq ($(TARGET_ARCH),x86_32)
13 CFLAGS += -m32 -march=i686
14 LDFLAGS := -m elf_i386
15 endif
17 ifeq ($(TARGET_ARCH),x86_64)
18 CFLAGS += -m64 -mno-red-zone -fpic -fno-reorder-blocks
19 CFLAGS += -fno-asynchronous-unwind-tables
20 LDFLAGS := -m elf_x86_64
21 endif
23 ifeq ($(debug),y)
24 CFLAGS += -g
25 else
26 CFLAGS += -O3
27 endif
29 TARGET := mini-os
31 OBJS := $(TARGET_ARCH).o
32 OBJS += $(patsubst %.c,%.o,$(wildcard *.c))
33 OBJS += $(patsubst %.c,%.o,$(wildcard lib/*.c))
34 OBJS += $(patsubst %.c,%.o,$(wildcard xenbus/*.c))
36 HDRS := $(wildcard include/*.h)
37 HDRS += $(wildcard include/xen/*.h)
39 default: $(TARGET)
41 links:
42 [ -e include/xen ] || ln -sf ../../../xen/include/public include/xen
43 [ -e xenbus/xenstored.h ] || ln -sf ../../../tools/xenstore/xenstored.h xenbus/xenstored.h
45 $(TARGET): links $(OBJS)
46 $(LD) -N -T minios-$(TARGET_ARCH).lds $(OBJS) -o $@.elf
47 gzip -f -9 -c $@.elf >$@.gz
49 clean:
50 find . -type f -name '*.o' | xargs rm -f
51 rm -f *.o *~ core $(TARGET).elf $(TARGET).raw $(TARGET) $(TARGET).gz
52 find . -type l | xargs rm -f
54 %.o: %.c $(HDRS) Makefile
55 $(CC) $(CFLAGS) -c $< -o $@
57 %.o: %.S $(HDRS) Makefile
58 $(CC) $(CFLAGS) -D__ASSEMBLY__ -c $< -o $@