source: mainline/Makefile@ 37cfd410

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 37cfd410 was efb94a77, checked in by Martin Sucha <sucha14@…>, 13 years ago

Add cscope_parts make target to generate separate cscope index for each subproject.

  • Property mode set to 100644
File size: 3.7 KB
RevLine 
[41f7564]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
[eb221e5]33CHECK = tools/check.sh
[8786aa5]34CONFIG = tools/config.py
[177e4ea]35AUTOTOOL = tools/autotool.py
[4e9aaf5]36SANDBOX = autotool
37
38CONFIG_RULES = HelenOS.config
39
40COMMON_MAKEFILE = Makefile.common
41COMMON_HEADER = common.h
42COMMON_HEADER_PREV = $(COMMON_HEADER).prev
43
44CONFIG_MAKEFILE = Makefile.config
45CONFIG_HEADER = config.h
[656437a0]46
[efb94a77]47.PHONY: all precheck cscope cscope_parts autotool config_auto config_default config distclean clean check releasefile release
[41f7564]48
[4e9aaf5]49all: $(COMMON_MAKEFILE) $(COMMON_HEADER) $(CONFIG_MAKEFILE) $(CONFIG_HEADER)
50 cp -a $(COMMON_HEADER) $(COMMON_HEADER_PREV)
[8786aa5]51 $(MAKE) -C kernel PRECHECK=$(PRECHECK)
52 $(MAKE) -C uspace PRECHECK=$(PRECHECK)
53 $(MAKE) -C boot PRECHECK=$(PRECHECK)
[41f7564]54
[8786aa5]55precheck: clean
56 $(MAKE) all PRECHECK=y
[656437a0]57
58cscope:
[b585dfa9]59 find abi kernel boot uspace -regex '^.*\.[chsS]$$' | xargs $(CSCOPE) -b -k -u -f$(CSCOPE).out
[656437a0]60
[efb94a77]61cscope_parts:
62 find abi -regex '^.*\.[chsS]$$' | xargs $(CSCOPE) -b -k -u -f$(CSCOPE)_abi.out
63 find kernel -regex '^.*\.[chsS]$$' | xargs $(CSCOPE) -b -k -u -f$(CSCOPE)_kernel.out
64 find boot -regex '^.*\.[chsS]$$' | xargs $(CSCOPE) -b -k -u -f$(CSCOPE)_boot.out
65 find uspace -regex '^.*\.[chsS]$$' | xargs $(CSCOPE) -b -k -u -f$(CSCOPE)_uspace.out
66
[eb221e5]67# Pre-integration build check
68check: $(CHECK)
69ifdef JOBS
70 $(CHECK) -j $(JOBS)
71else
72 $(CHECK)
73endif
74
[83fd0d7]75# Autotool (detects compiler features)
76
[c6f4681]77autotool $(COMMON_MAKEFILE) $(COMMON_HEADER): $(CONFIG_MAKEFILE)
[177e4ea]78 $(AUTOTOOL)
[4e9aaf5]79 -[ -f $(COMMON_HEADER_PREV) ] && diff -q $(COMMON_HEADER_PREV) $(COMMON_HEADER) && mv -f $(COMMON_HEADER_PREV) $(COMMON_HEADER)
[177e4ea]80
[83fd0d7]81# Build-time configuration
82
[c6f4681]83config_default $(CONFIG_MAKEFILE) $(CONFIG_HEADER): $(CONFIG_RULES)
[e3c3172]84ifeq ($(HANDS_OFF),y)
85 $(CONFIG) $< hands-off $(PROFILE)
86else
[6ec0acd]87 $(CONFIG) $< default $(PROFILE)
[e3c3172]88endif
[4cac212c]89
[4e9aaf5]90config: $(CONFIG_RULES)
91 $(CONFIG) $<
[41f7564]92
[471569b]93# Release files
[83fd0d7]94
[471569b]95releasefile: all
96 $(MAKE) -C release releasefile
[83fd0d7]97
[471569b]98release:
99 $(MAKE) -C release release
[83fd0d7]100
101# Cleaning
102
[9a0367f]103distclean: clean
[406d514]104 rm -f $(CSCOPE).out $(COMMON_MAKEFILE) $(COMMON_HEADER) $(COMMON_HEADER_PREV) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) tools/*.pyc tools/checkers/*.pyc release/HelenOS-*
[2431f30]105 cd ./uspace/app/binutils/; ./distclean.sh
[41f7564]106
107clean:
[4e9aaf5]108 rm -fr $(SANDBOX)
[656437a0]109 $(MAKE) -C kernel clean
110 $(MAKE) -C uspace clean
111 $(MAKE) -C boot clean
[4bc309b]112
113-include Makefile.local
Note: See TracBrowser for help on using the repository browser.