aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/bug014
Commit message (Expand)AuthorAgeFilesLines
* Rename gnat/bug directories for non-gna bugs to avoid confusion.Tristan Gingold2015-08-294-0/+36
id='n21' href='#n21'>21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
# Default is to install to local 'dist' directory.
DISTDIR ?= ../dist
DESTDIR ?= $(DISTDIR)/install

INSTALL			= install
INSTALL_DATA		= $(INSTALL) -m0644
INSTALL_DIR		= $(INSTALL) -d -m0755

# This is the correct place to edit the build version.
# All other places this is stored (eg. compile.h) should be autogenerated.
export XEN_VERSION       = 3
export XEN_SUBVERSION    = 0
export XEN_EXTRAVERSION  = "-devel"

export BASEDIR          := $(CURDIR)

include Rules.mk

default: $(TARGET).gz
$(TARGET).gz: $(TARGET)
	gzip -f -9 < $< > $@.new
	mv $@.new $@

debug:	
	objdump -D -S $(TARGET)-syms > $(TARGET).s

dist:
	$(MAKE) install

install: $(TARGET).gz
	[ -d $(DESTDIR)/boot ] || $(INSTALL_DIR) $(DESTDIR)/boot
	$(INSTALL_DATA) $(TARGET).gz $(DESTDIR)/boot
	$(INSTALL_DATA) $(TARGET)-syms $(DESTDIR)/boot
	[ -d $(DESTDIR)/usr/include/xen/io ] || \
		$(INSTALL_DIR) $(DESTDIR)/usr/include/xen/io
	$(INSTALL_DATA) include/public/*.h $(DESTDIR)/usr/include/xen
	$(INSTALL_DATA) include/public/io/*.h $(DESTDIR)/usr/include/xen/io
	$(INSTALL_DATA) include/public/COPYING $(DESTDIR)/usr/include/xen

clean:
	$(MAKE) -C tools clean
	$(MAKE) -C common clean
	$(MAKE) -C drivers clean
	$(MAKE) -C arch/$(TARGET_ARCH) clean
	rm -f include/asm *.o $(TARGET)* *~ core include/xen/compile.h
	rm -f include/asm-*/asm-offsets.h
	rm -f tools/figlet/*.o tools/figlet/figlet

$(TARGET): delete-unfresh-files include/xen/compile.h
	[ -e include/asm ] || ln -sf asm-$(TARGET_ARCH) include/asm
	$(MAKE) -C arch/$(TARGET_ARCH) asm-offsets.s
	$(MAKE) include/asm-$(TARGET_ARCH)/asm-offsets.h
	$(MAKE) -C common
	$(MAKE) -C drivers
	$(MAKE) -C arch/$(TARGET_ARCH)

# drivers/char/console.o may contain static banner/compile info. Blow it away.
delete-unfresh-files:
	rm -f include/xen/banner.h include/xen/compile.h drivers/char/console.o
	$(MAKE) -C arch/$(TARGET_ARCH) delete-unfresh-files

# compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
include/xen/compile.h: LANG=C
include/xen/compile.h: include/xen/compile.h.in include/xen/banner.h
	@sed -e 's/@@date@@/$(shell date)/g' \
	    -e 's/@@time@@/$(shell date +%T)/g' \
	    -e 's/@@whoami@@/$(shell whoami)/g' \
	    -e 's/@@domain@@/$(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown]))/g' \
	    -e 's/@@hostname@@/$(shell hostname)/g' \
	    -e 's/@@compiler@@/$(shell $(CC) $(CFLAGS) -v 2>&1 | tail -1)/g' \
	    -e 's/@@version@@/$(XEN_VERSION)/g' \
	    -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
	    -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
	    -e 's!@@changeset@@!$(shell bk changes -nd':D: :T: :REV: :MD5KEY:' -r+ 2>/dev/null || echo information unavailable)!g' \
	    < include/xen/compile.h.in > $@.new
	@cat include/xen/banner.h >> $@.new
	@mv -f $@.new $@

tools/figlet/figlet: tools/figlet/figlet.o
	$(HOSTCC) -o $@ $<
tools/figlet/figlet.o: tools/figlet/figlet.c
	$(HOSTCC) -o $@ -c $<

include/xen/banner.h: tools/figlet/figlet tools/figlet/xen.flf
	tools/figlet/figlet -d tools/figlet Xen $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION) > $@.new
	@mv -f $@.new $@

include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
	@(set -e; \
	  echo "/*"; \
	  echo " * DO NOT MODIFY."; \
	  echo " *"; \
	  echo " * This file was auto-generated from $<"; \
	  echo " *"; \
	  echo " */"; \
	  echo ""; \
	  echo "#ifndef __ASM_OFFSETS_H__"; \
	  echo "#define __ASM_OFFSETS_H__"; \
	  echo ""; \
	  sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
	  echo ""; \
	  echo "#endif") <$< >$@.tmp
	@if cmp -s $@.tmp $@; then rm $@.tmp; else rm $@; mv $@.tmp $@; fi

.PHONY: default debug install dist clean delete-unfresh-files TAGS

SUBDIRS = arch common drivers 
TAGS: 
	( find include/asm-$(TARGET_ARCH) -name '*.h'; \
	  find include -type d \( -name "asm-*" -o -name config \) -prune -o \
		-name '*.h' -print; \
	  find $(SUBDIRS) -name '*.[chS]' ) | grep -v /SCCS/ | etags -
MAP:
	nm $(TARGET) | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map