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
Line 
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
29# Just for this Makefile. Sub-makes will run in parallel if requested.
30.NOTPARALLEL:
31
32CSCOPE = cscope
33CHECK = tools/check.sh
34CONFIG = tools/config.py
35AUTOTOOL = tools/autotool.py
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
46
47.PHONY: all precheck cscope cscope_parts autotool config_auto config_default config distclean clean check releasefile release
48
49all: $(COMMON_MAKEFILE) $(COMMON_HEADER) $(CONFIG_MAKEFILE) $(CONFIG_HEADER)
50 cp -a $(COMMON_HEADER) $(COMMON_HEADER_PREV)
51 $(MAKE) -C kernel PRECHECK=$(PRECHECK)
52 $(MAKE) -C uspace PRECHECK=$(PRECHECK)
53 $(MAKE) -C boot PRECHECK=$(PRECHECK)
54
55precheck: clean
56 $(MAKE) all PRECHECK=y
57
58cscope:
59 find abi kernel boot uspace -regex '^.*\.[chsS]$$' | xargs $(CSCOPE) -b -k -u -f$(CSCOPE).out
60
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
67# Pre-integration build check
68check: $(CHECK)
69ifdef JOBS
70 $(CHECK) -j $(JOBS)
71else
72 $(CHECK)
73endif
74
75# Autotool (detects compiler features)
76
77autotool $(COMMON_MAKEFILE) $(COMMON_HEADER): $(CONFIG_MAKEFILE)
78 $(AUTOTOOL)
79 -[ -f $(COMMON_HEADER_PREV) ] && diff -q $(COMMON_HEADER_PREV) $(COMMON_HEADER) && mv -f $(COMMON_HEADER_PREV) $(COMMON_HEADER)
80
81# Build-time configuration
82
83config_default $(CONFIG_MAKEFILE) $(CONFIG_HEADER): $(CONFIG_RULES)
84ifeq ($(HANDS_OFF),y)
85 $(CONFIG) $< hands-off $(PROFILE)
86else
87 $(CONFIG) $< default $(PROFILE)
88endif
89
90config: $(CONFIG_RULES)
91 $(CONFIG) $<
92
93# Release files
94
95releasefile: all
96 $(MAKE) -C release releasefile
97
98release:
99 $(MAKE) -C release release
100
101# Cleaning
102
103distclean: clean
104 rm -f $(CSCOPE).out $(COMMON_MAKEFILE) $(COMMON_HEADER) $(COMMON_HEADER_PREV) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) tools/*.pyc tools/checkers/*.pyc release/HelenOS-*
105 cd ./uspace/app/binutils/; ./distclean.sh
106
107clean:
108 rm -fr $(SANDBOX)
109 $(MAKE) -C kernel clean
110 $(MAKE) -C uspace clean
111 $(MAKE) -C boot clean
112
113-include Makefile.local
Note: See TracBrowser for help on using the repository browser.