/3rdparty/pybind11/.github/

on> xenJames
aboutsummaryrefslogtreecommitdiffstats
path: root/xen/Makefile
blob: cedd21396e91fde4387fd56777bba234ae95b99f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# 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 ?= -unstable
export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
-include xen-version

export BASEDIR := $(CURDIR)

.PHONY: default
default: build

.PHONY: dist
dist: install

.PHONY: build install clean distclean cscope TAGS tags
build install debug clean distclean cscope TAGS tags::
	make -f Rules.mk _$@

.PHONY: _build
_build: $(TARGET).gz

.PHONY: _install
_install: $(TARGET).gz
	[ -d $(DESTDIR)/boot ] || $(INSTALL_DIR) $(DESTDIR)/boot
	$(INSTALL_DATA) $(TARGET).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_FULLVERSION).gz
	ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION).gz
	ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).gz
	ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET)).gz
	$(INSTALL_DATA) $(TARGET)-syms $(DESTDIR)/boot/$(notdir $(TARGET))-syms-$(XEN_FULLVERSION)
	[ -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

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

.PHONY: _clean
_clean: delete-unfresh-files
	$(MAKE) -C tools clean
	$(MAKE) -f $(BASEDIR)/Rules.mk -C common clean
	$(MAKE) -f $(BASEDIR)/Rules.mk -C drivers clean
	$(MAKE) -f $(BASEDIR)/Rules.mk -C acm clean
	$(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
	rm -f include/asm *.o $(TARGET)* *~ core
	rm -f include/asm-*/asm-offsets.h
	rm -f include/xen/acm_policy.h

.PHONY: _distclean
_distclean: clean
	rm -f tags TAGS cscope.files cscope.in.out cscope.out cscope.po.out

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

$(TARGET): delete-unfresh-files
	$(MAKE) -C tools
	$(MAKE) -f $(BASEDIR)/Rules.mk include/xen/compile.h
	$(MAKE) -f $(BASEDIR)/Rules.mk include/xen/acm_policy.h
	[ -e include/asm ] || ln -sf asm-$(TARGET_ARCH) include/asm
	$(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) asm-offsets.s
	$(MAKE) -f $(BASEDIR)/Rules.mk include/asm-$(TARGET_ARCH)/asm-offsets.h
	$(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) $(TARGET)

# drivers/char/console.o contains static banner/compile info. Blow it away.
# Don't refresh these files during e.g., 'sudo make install'
.PHONY: delete-unfresh-files
delete-unfresh-files:
	@if [ ! -r include/xen/compile.h -o -O include/xen/compile.h ]; then \
		rm -f include/xen/{banner,compile}.h; \
	fi

# acm_policy.h contains security policy for Xen
include/xen/acm_policy.h:
	@(set -e; \
	  echo "/*"; \
	  echo " * DO NOT MODIFY."; \
	  echo " *"; \
	  echo " * This file was auto-generated by xen/Makefile $<"; \
	  echo " *"; \
	  echo " */"; \
	  echo ""; \
	  echo "#ifndef ACM_DEFAULT_SECURITY_POLICY"; \
	  echo "#define ACM_DEFAULT_SECURITY_POLICY $(ACM_DEFAULT_SECURITY_POLICY)"; \
	  echo "#endif") >$@

# 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 -n 1 | sed -e "s;|;/;")|g' \
	    -e 's/@@version@@/$(XEN_VERSION)/g' \
	    -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
	    -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
	    -e 's!@@changeset@@!$(shell ((hg parents || head -n 7 ../ChangeLog || echo date: unavailable) | awk '{FS="changeset:[ ]+"}/^changeset/{CS=$$2};{FS="date:[ ]+"}/^date/{D=$$2}; END {print D, CS}') 2>/dev/null)!g' \
	    < include/xen/compile.h.in > $@.new
	@cat include/xen/banner.h >> $@.new
	@mv -f $@.new $@

include/xen/banner.h:
	tools/figlet/figlet -d tools/figlet Xen $(XEN_FULLVERSION) > $@.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") <$< >$@

SUBDIRS = acm arch/$(TARGET_ARCH) common drivers 
define all_sources
    ( find include/asm-$(TARGET_ARCH) -name SCCS -prune -o -name '*.h' -print; \
      find include -type d -name SCCS -prune -o \( -name "asm-*" -o \
            -name config \) -prune -o -name '*.h' -print; \
      find $(SUBDIRS) -name SCCS -prune -o -name '*.[chS]' -print )
endef

.PHONY: _TAGS
_TAGS: 
	rm -f TAGS && $(all_sources) | xargs etags -a

.PHONY: _tags
_tags: 
	rm -f TAGS && $(all_sources) | xargs ctags -a

.PHONY: _cscope
_cscope:
	$(all_sources) > cscope.files
	cscope -k -b -q

.PHONY: MAP
MAP:
	$(NM) $(TARGET) | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map