source: mainline/Makefile@ 541eb67

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 541eb67 was 3529fbf0, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 8 years ago

Ensure that errno.h constants aren't missing textual descriptions.

  • Property mode set to 100644
File size: 4.2 KB
RevLine 
[3654684]1#
[df4ed85]2# Copyright (c) 2006 Martin Decky
[41f7564]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
[bb285b4]29# Just for this Makefile. Sub-makes will run in parallel if requested.
30.NOTPARALLEL:
31
[218e50c]32CSCOPE = cscope
[b1efe3e]33FORMAT = clang-format
[eb221e5]34CHECK = tools/check.sh
[8786aa5]35CONFIG = tools/config.py
[177e4ea]36AUTOTOOL = tools/autotool.py
[4e9aaf5]37SANDBOX = autotool
38
39CONFIG_RULES = HelenOS.config
40
41COMMON_MAKEFILE = Makefile.common
42COMMON_HEADER = common.h
43
44CONFIG_MAKEFILE = Makefile.config
45CONFIG_HEADER = config.h
[3529fbf0]46ERRNO_HEADER = abi/include/abi/errno.h
47ERRNO_INPUT = abi/include/abi/errno.in
[656437a0]48
[feab36ae]49.PHONY: all precheck cscope cscope_parts autotool config_auto config_default config distclean clean check releasefile release common boot kernel uspace
[41f7564]50
[feab36ae]51all: kernel uspace
52 $(MAKE) -r -C boot PRECHECK=$(PRECHECK)
53
[3529fbf0]54common: $(COMMON_MAKEFILE) $(COMMON_HEADER) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) $(ERRNO_HEADER)
[feab36ae]55
56kernel: common
[e540bc87]57 $(MAKE) -r -C kernel PRECHECK=$(PRECHECK)
[feab36ae]58
59uspace: common
[e540bc87]60 $(MAKE) -r -C uspace PRECHECK=$(PRECHECK)
[41f7564]61
[8786aa5]62precheck: clean
[e540bc87]63 $(MAKE) -r all PRECHECK=y
[656437a0]64
65cscope:
[6eda732]66 find abi kernel boot uspace -type f -regex '^.*\.[chsS]$$' | xargs $(CSCOPE) -b -k -u -f$(CSCOPE).out
[656437a0]67
[efb94a77]68cscope_parts:
[6eda732]69 find abi -type f -regex '^.*\.[chsS]$$' | xargs $(CSCOPE) -b -k -u -f$(CSCOPE)_abi.out
70 find kernel -type f -regex '^.*\.[chsS]$$' | xargs $(CSCOPE) -b -k -u -f$(CSCOPE)_kernel.out
71 find boot -type f -regex '^.*\.[chsS]$$' | xargs $(CSCOPE) -b -k -u -f$(CSCOPE)_boot.out
72 find uspace -type f -regex '^.*\.[chsS]$$' | xargs $(CSCOPE) -b -k -u -f$(CSCOPE)_uspace.out
[efb94a77]73
[b1efe3e]74format:
75 find abi kernel boot uspace -type f -regex '^.*\.[ch]$$' | xargs $(FORMAT) -i -sort-includes -style=file
76
[7f345cd0]77doxy:
78 $(MAKE) -r -C doxygen
79
[eb221e5]80# Pre-integration build check
81check: $(CHECK)
82ifdef JOBS
83 $(CHECK) -j $(JOBS)
84else
85 $(CHECK)
86endif
87
[83fd0d7]88# Autotool (detects compiler features)
89
[cc92076]90autotool $(COMMON_MAKEFILE) $(COMMON_HEADER): $(CONFIG_MAKEFILE) $(AUTOTOOL)
[177e4ea]91 $(AUTOTOOL)
[cc92076]92 diff -q $(COMMON_HEADER).new $(COMMON_HEADER) 2> /dev/null; if [ $$? -ne 0 ]; then mv -f $(COMMON_HEADER).new $(COMMON_HEADER); fi
[177e4ea]93
[83fd0d7]94# Build-time configuration
95
[c6f4681]96config_default $(CONFIG_MAKEFILE) $(CONFIG_HEADER): $(CONFIG_RULES)
[e3c3172]97ifeq ($(HANDS_OFF),y)
98 $(CONFIG) $< hands-off $(PROFILE)
99else
[6ec0acd]100 $(CONFIG) $< default $(PROFILE)
[e3c3172]101endif
[4cac212c]102
[4e9aaf5]103config: $(CONFIG_RULES)
104 $(CONFIG) $<
[41f7564]105
[f857e8b]106random-config: $(CONFIG_RULES)
107 $(CONFIG) $< random
108
[471569b]109# Release files
[83fd0d7]110
[471569b]111releasefile: all
[e540bc87]112 $(MAKE) -r -C release releasefile
[83fd0d7]113
[471569b]114release:
[e540bc87]115 $(MAKE) -r -C release release
[83fd0d7]116
117# Cleaning
118
[9a0367f]119distclean: clean
[cc92076]120 rm -f $(CSCOPE).out $(COMMON_MAKEFILE) $(COMMON_HEADER) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) tools/*.pyc tools/checkers/*.pyc release/HelenOS-*
[41f7564]121
122clean:
[4e9aaf5]123 rm -fr $(SANDBOX)
[e540bc87]124 $(MAKE) -r -C kernel clean
125 $(MAKE) -r -C uspace clean
126 $(MAKE) -r -C boot clean
[7f345cd0]127 $(MAKE) -r -C doxygen clean
[4bc309b]128
[3529fbf0]129$(ERRNO_HEADER): $(ERRNO_INPUT)
130 echo '/* Generated file. Edit errno.in instead. */' > $@.new
131 sed 's/__errno_entry(\([^,]*\),\([^,]*\),.*/#define \1 \2/' < $< >> $@.new
132 mv $@.new $@
133
[4bc309b]134-include Makefile.local
Note: See TracBrowser for help on using the repository browser.