~jakub/helenos/ia64-revival

1 by Martin Decky
Initial import
1
#
2
# Copyright (c) 2006 Martin Decky
3
# All rights reserved.
4
#
5
# Redistribution and use in source and binary forms, with or without
6
# modification, are permitted provided that the following conditions
7
# are met:
8
#
9
# - Redistributions of source code must retain the above copyright
10
#   notice, this list of conditions and the following disclaimer.
11
# - Redistributions in binary form must reproduce the above copyright
12
#   notice, this list of conditions and the following disclaimer in the
13
#   documentation and/or other materials provided with the distribution.
14
# - The name of the author may not be used to endorse or promote products
15
#   derived from this software without specific prior written permission.
16
#
17
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
#
28
527.97.48 by Petr Koupy
Improved reliability and speed of the parallel build.
29
# Just for this Makefile. Sub-makes will run in parallel if requested.
30
.NOTPARALLEL:
31
146 by Martin Decky
style changes
32
CSCOPE = cscope
527.1.226 by Jakub Jermar
Add a script to check that all supported build profiles build well.
33
CHECK = tools/check.sh
188 by Martin Decky
remove Stanse-specific constructs from makefiles
34
CONFIG = tools/config.py
322 by Martin Decky
move from a simple sanity check tool to a more feature-rich configuration autotool (generates Makefile.common)
35
AUTOTOOL = tools/autotool.py
324 by Martin Decky
more autotooling: run actually the compiler in autotool.py and detect sizes of integers, generate common.h
36
SANDBOX = autotool
37
38
CONFIG_RULES = HelenOS.config
39
40
COMMON_MAKEFILE = Makefile.common
41
COMMON_HEADER = common.h
42
COMMON_HEADER_PREV = $(COMMON_HEADER).prev
43
44
CONFIG_MAKEFILE = Makefile.config
45
CONFIG_HEADER = config.h
322 by Martin Decky
move from a simple sanity check tool to a more feature-rich configuration autotool (generates Makefile.common)
46
527.1.355 by Jiri Svoboda
Rename things 'dist' to 'release'.
47
.PHONY: all precheck cscope autotool config_auto config_default config distclean clean check releasefile release
322 by Martin Decky
move from a simple sanity check tool to a more feature-rich configuration autotool (generates Makefile.common)
48
324 by Martin Decky
more autotooling: run actually the compiler in autotool.py and detect sizes of integers, generate common.h
49
all: $(COMMON_MAKEFILE) $(COMMON_HEADER) $(CONFIG_MAKEFILE) $(CONFIG_HEADER)
50
	cp -a $(COMMON_HEADER) $(COMMON_HEADER_PREV)
188 by Martin Decky
remove Stanse-specific constructs from makefiles
51
	$(MAKE) -C kernel PRECHECK=$(PRECHECK)
52
	$(MAKE) -C uspace PRECHECK=$(PRECHECK)
53
	$(MAKE) -C boot PRECHECK=$(PRECHECK)
1 by Martin Decky
Initial import
54
188 by Martin Decky
remove Stanse-specific constructs from makefiles
55
precheck: clean
56
	$(MAKE) all PRECHECK=y
145 by Martin Decky
add basic support for Stanse static checker (http://stanse.fi.muni.cz/)
57
58
cscope:
527.83.1 by Jakub Jermar
Index abi/ subtree by cscope too.
59
	find abi kernel boot uspace -regex '^.*\.[chsS]$$' | xargs $(CSCOPE) -b -k -u -f$(CSCOPE).out
145 by Martin Decky
add basic support for Stanse static checker (http://stanse.fi.muni.cz/)
60
527.1.226 by Jakub Jermar
Add a script to check that all supported build profiles build well.
61
# Pre-integration build check
62
check: $(CHECK)
63
ifdef JOBS 
64
	$(CHECK) -j $(JOBS)
65
else
66
	$(CHECK)
67
endif
68
527.1.336 by Jiri Svoboda
Attempt at automatic building of release files. To do:
69
# Autotool (detects compiler features)
70
527.97.41 by Petr Koupy
Corrected unnecessary regeneration of config.h and common.h to avoid rebuild of already built binutils.
71
autotool $(COMMON_MAKEFILE) $(COMMON_HEADER): $(CONFIG_MAKEFILE)
322 by Martin Decky
move from a simple sanity check tool to a more feature-rich configuration autotool (generates Makefile.common)
72
	$(AUTOTOOL)
324 by Martin Decky
more autotooling: run actually the compiler in autotool.py and detect sizes of integers, generate common.h
73
	-[ -f $(COMMON_HEADER_PREV) ] && diff -q $(COMMON_HEADER_PREV) $(COMMON_HEADER) && mv -f $(COMMON_HEADER_PREV) $(COMMON_HEADER)
74
527.1.336 by Jiri Svoboda
Attempt at automatic building of release files. To do:
75
# Build-time configuration
76
527.97.41 by Petr Koupy
Corrected unnecessary regeneration of config.h and common.h to avoid rebuild of already built binutils.
77
config_default $(CONFIG_MAKEFILE) $(CONFIG_HEADER): $(CONFIG_RULES)
527.1.214 by Martin Decky
introduce a true hands-off configuration/build mode
78
ifeq ($(HANDS_OFF),y)
79
	$(CONFIG) $< hands-off $(PROFILE)
80
else
527.15.6 by Jiri Svoboda
Fix two-level profiles.
81
	$(CONFIG) $< default $(PROFILE)
527.1.214 by Martin Decky
introduce a true hands-off configuration/build mode
82
endif
324 by Martin Decky
more autotooling: run actually the compiler in autotool.py and detect sizes of integers, generate common.h
83
84
config: $(CONFIG_RULES)
85
	$(CONFIG) $<
1 by Martin Decky
Initial import
86
527.1.355 by Jiri Svoboda
Rename things 'dist' to 'release'.
87
# Release files
88
89
releasefile: all
90
	$(MAKE) -C release releasefile
91
92
release:
93
	$(MAKE) -C release release
527.1.336 by Jiri Svoboda
Attempt at automatic building of release files. To do:
94
95
# Cleaning
96
1 by Martin Decky
Initial import
97
distclean: clean
527.1.356 by Jiri Svoboda
Fix omissions.
98
	rm -f $(CSCOPE).out $(COMMON_MAKEFILE) $(COMMON_HEADER) $(COMMON_HEADER_PREV) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) tools/*.pyc tools/checkers/*.pyc release/HelenOS-*
527.97.12 by Petr Koupy
Build process debugged and improved.
99
	cd ./uspace/app/binutils/; ./distclean.sh
1 by Martin Decky
Initial import
100
101
clean:
324 by Martin Decky
more autotooling: run actually the compiler in autotool.py and detect sizes of integers, generate common.h
102
	rm -fr $(SANDBOX)
145 by Martin Decky
add basic support for Stanse static checker (http://stanse.fi.muni.cz/)
103
	$(MAKE) -C kernel clean
104
	$(MAKE) -C uspace clean
105
	$(MAKE) -C boot clean
527.48.2 by Vojtech Horky
Add ignore file and local Makefile
106
107
-include Makefile.local