Subversion Repositories HelenOS

Rev

Rev 3803 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3803 Rev 3888
1
#
1
#
2
# Copyright (c) 2006 Martin Decky
2
# Copyright (c) 2006 Martin Decky
3
# All rights reserved.
3
# All rights reserved.
4
#
4
#
5
# Redistribution and use in source and binary forms, with or without
5
# Redistribution and use in source and binary forms, with or without
6
# modification, are permitted provided that the following conditions
6
# modification, are permitted provided that the following conditions
7
# are met:
7
# are met:
8
#
8
#
9
# - Redistributions of source code must retain the above copyright
9
# - Redistributions of source code must retain the above copyright
10
#   notice, this list of conditions and the following disclaimer.
10
#   notice, this list of conditions and the following disclaimer.
11
# - Redistributions in binary form must reproduce the above copyright
11
# - Redistributions in binary form must reproduce the above copyright
12
#   notice, this list of conditions and the following disclaimer in the
12
#   notice, this list of conditions and the following disclaimer in the
13
#   documentation and/or other materials provided with the distribution.
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
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.
15
#   derived from this software without specific prior written permission.
16
#
16
#
17
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
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
18
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
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
23
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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
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.
26
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
#
27
#
28
 
28
 
29
## Include configuration
29
## Include configuration
30
#
30
#
31
 
31
 
32
-include Makefile.config
32
-include Makefile.config
33
 
33
 
34
## Setup platform configuration
34
## Setup platform configuration
35
#
35
#
36
 
36
 
37
ifeq ($(PLATFORM),amd64)
37
ifeq ($(PLATFORM),amd64)
38
	KARCH = amd64
38
	KARCH = amd64
39
	UARCH = amd64
39
	UARCH = amd64
40
	BARCH = amd64
40
	BARCH = amd64
41
endif
41
endif
42
 
42
 
43
ifeq ($(PLATFORM),arm32)
43
ifeq ($(PLATFORM),arm32)
44
	KARCH = arm32
44
	KARCH = arm32
45
	UARCH = arm32
45
	UARCH = arm32
46
	BARCH = arm32
46
	BARCH = arm32
47
endif
47
endif
48
 
48
 
49
ifeq ($(PLATFORM),ia32)
49
ifeq ($(PLATFORM),ia32)
50
	KARCH = ia32
50
	KARCH = ia32
51
	UARCH = ia32
51
	UARCH = ia32
52
	BARCH = ia32
52
	BARCH = ia32
53
endif
53
endif
54
 
54
 
55
ifeq ($(PLATFORM),ia64)
55
ifeq ($(PLATFORM),ia64)
56
	KARCH = ia64
56
	KARCH = ia64
57
	UARCH = ia64
57
	UARCH = ia64
58
	BARCH = ia64
58
	BARCH = ia64
59
endif
59
endif
60
 
60
 
61
ifeq ($(PLATFORM),mips32)
61
ifeq ($(PLATFORM),mips32)
62
	KARCH = mips32
62
	KARCH = mips32
63
	BARCH = mips32
63
	BARCH = mips32
64
	
64
	
65
	ifeq ($(MACHINE),msim)
65
	ifeq ($(MACHINE),msim)
66
		UARCH = mips32
66
		UARCH = mips32
67
		IMAGE = binary
67
		IMAGE = binary
68
	endif
68
	endif
69
	
69
	
70
	ifeq ($(MACHINE),simics)
70
	ifeq ($(MACHINE),simics)
71
		UARCH = mips32
71
		UARCH = mips32
72
		IMAGE = ecoff
72
		IMAGE = ecoff
73
	endif
73
	endif
74
	
74
	
75
	ifeq ($(MACHINE),bgxemul)
75
	ifeq ($(MACHINE),bgxemul)
76
		UARCH = mips32eb
76
		UARCH = mips32eb
77
		IMAGE = ecoff
77
		IMAGE = ecoff
78
	endif
78
	endif
79
	
79
	
80
	ifeq ($(MACHINE),lgxemul)
80
	ifeq ($(MACHINE),lgxemul)
81
		UARCH = mips32
81
		UARCH = mips32
82
		IMAGE = ecoff
82
		IMAGE = ecoff
83
	endif
83
	endif
84
endif
84
endif
85
 
85
 
86
ifeq ($(PLATFORM),ppc32)
86
ifeq ($(PLATFORM),ppc32)
87
	KARCH = ppc32
87
	KARCH = ppc32
88
	UARCH = ppc32
88
	UARCH = ppc32
89
	BARCH = ppc32
89
	BARCH = ppc32
90
endif
90
endif
91
 
91
 
92
ifeq ($(PLATFORM),ppc64)
92
ifeq ($(PLATFORM),ppc64)
93
	KARCH = ppc64
93
	KARCH = ppc64
94
	UARCH = ppc64
94
	UARCH = ppc64
95
	BARCH = ppc64
95
	BARCH = ppc64
96
endif
96
endif
97
 
97
 
98
ifeq ($(PLATFORM),sparc64)
98
ifeq ($(PLATFORM),sparc64)
99
	KARCH = sparc64
99
	KARCH = sparc64
100
	UARCH = sparc64
100
	UARCH = sparc64
101
	BARCH = sparc64
101
	BARCH = sparc64
102
endif
102
endif
103
 
103
 
104
ifeq ($(PLATFORM),ia32xen)
104
ifeq ($(PLATFORM),ia32xen)
105
	KARCH = ia32xen
105
	KARCH = ia32xen
106
	UARCH = ia32
106
	UARCH = ia32
107
	BARCH = ia32xen
107
	BARCH = ia32xen
108
endif
108
endif
109
 
109
 
110
.PHONY: all build config distclean clean cscope
110
.PHONY: all build config distclean clean cscope
111
 
111
 
112
all:
112
all:
113
	tools/config.py HelenOS.config default
113
	tools/config.py HelenOS.config default
114
	$(MAKE) -C . build
114
	$(MAKE) -C . build
115
 
115
 
116
build: Makefile.config
116
build: Makefile.config
117
	$(MAKE) -C kernel ARCH=$(KARCH)
117
	$(MAKE) -C kernel ARCH=$(KARCH)
118
	$(MAKE) -C uspace ARCH=$(UARCH)
118
	$(MAKE) -C uspace ARCH=$(UARCH)
119
	$(MAKE) -C boot ARCH=$(BARCH) IMAGE=$(IMAGE)
119
	$(MAKE) -C boot ARCH=$(BARCH) IMAGE=$(IMAGE)
120
 
120
 
121
config: HelenOS.config
121
config: HelenOS.config
122
	tools/config.py HelenOS.config
122
	tools/config.py HelenOS.config
123
 
123
 
124
distclean: clean
124
distclean: clean
125
	rm -f Makefile.config tools/*.pyc
125
	rm -f Makefile.config tools/*.pyc
126
 
126
 
127
clean:
127
clean:
128
	-$(MAKE) -C kernel clean ARCH=$(KARCH)
128
	-$(MAKE) -C kernel clean ARCH=$(KARCH)
129
	-$(MAKE) -C uspace clean ARCH=$(UARCH)
129
	-$(MAKE) -C uspace clean ARCH=$(UARCH)
130
	-$(MAKE) -C boot clean ARCH=$(BARCH) IMAGE=$(IMAGE)
130
	-$(MAKE) -C boot clean ARCH=$(BARCH) IMAGE=$(IMAGE)
131
 
131
 
132
cscope:
132
cscope:
133
	find kernel boot uspace -regex '^.*\.[chsS]$$' -print > srclist
133
	find kernel boot uspace -regex '^.*\.[chsS]$$' -print > srclist
134
	rm -f cscope.out
134
	rm -f cscope.out
135
	cscope -bi srclist
135
	cscope -bi srclist
136
 
136