Subversion Repositories HelenOS

Rev

Rev 3466 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3466 Rev 3666
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
	MACHINE = opteron
39
	MACHINE = opteron
40
	UARCH = amd64
40
	UARCH = amd64
41
	BARCH = amd64
41
	BARCH = amd64
42
endif
42
endif
43
 
43
 
44
ifeq ($(PLATFORM),arm32)
44
ifeq ($(PLATFORM),arm32)
45
	KARCH = arm32
45
	KARCH = arm32
46
	UARCH = arm32
46
	UARCH = arm32
47
	BARCH = arm32
47
	BARCH = arm32
48
endif
48
endif
49
 
49
 
50
ifeq ($(PLATFORM),ia32)
50
ifeq ($(PLATFORM),ia32)
51
	KARCH = ia32
51
	KARCH = ia32
52
	UARCH = ia32
52
	UARCH = ia32
53
	BARCH = ia32
53
	BARCH = ia32
54
endif
54
endif
55
 
55
 
56
ifeq ($(PLATFORM),ia64)
56
ifeq ($(PLATFORM),ia64)
57
	KARCH = ia64
57
	KARCH = ia64
58
	UARCH = ia64
58
	UARCH = ia64
59
	BARCH = ia64
59
	BARCH = ia64
60
endif
60
endif
61
 
61
 
62
ifeq ($(PLATFORM),mips32)
62
ifeq ($(PLATFORM),mips32)
63
	KARCH = mips32
63
	KARCH = mips32
64
	BARCH = mips32
64
	BARCH = mips32
65
	
65
	
66
	ifeq ($(MACHINE),msim)
66
	ifeq ($(MACHINE),msim)
67
		UARCH = mips32
67
		UARCH = mips32
68
		IMAGE = binary
68
		IMAGE = binary
69
	endif
69
	endif
70
	
70
	
71
	ifeq ($(MACHINE),simics)
71
	ifeq ($(MACHINE),simics)
72
		UARCH = mips32
72
		UARCH = mips32
73
		IMAGE = ecoff
73
		IMAGE = ecoff
74
	endif
74
	endif
75
	
75
	
76
	ifeq ($(MACHINE),bgxemul)
76
	ifeq ($(MACHINE),bgxemul)
77
		UARCH = mips32eb
77
		UARCH = mips32eb
78
		IMAGE = ecoff
78
		IMAGE = ecoff
79
	endif
79
	endif
80
	
80
	
81
	ifeq ($(MACHINE),lgxemul)
81
	ifeq ($(MACHINE),lgxemul)
82
		UARCH = mips32
82
		UARCH = mips32
83
		IMAGE = ecoff
83
		IMAGE = ecoff
84
	endif
84
	endif
85
endif
85
endif
86
 
86
 
87
ifeq ($(PLATFORM),ppc32)
87
ifeq ($(PLATFORM),ppc32)
88
	KARCH = ppc32
88
	KARCH = ppc32
89
	UARCH = ppc32
89
	UARCH = ppc32
90
	BARCH = ppc32
90
	BARCH = ppc32
91
endif
91
endif
92
 
92
 
93
ifeq ($(PLATFORM),ppc64)
93
ifeq ($(PLATFORM),ppc64)
94
	KARCH = ppc64
94
	KARCH = ppc64
95
	UARCH = ppc64
95
	UARCH = ppc64
96
	BARCH = ppc64
96
	BARCH = ppc64
97
endif
97
endif
98
 
98
 
99
ifeq ($(PLATFORM),sparc64)
99
ifeq ($(PLATFORM),sparc64)
100
	KARCH = sparc64
100
	KARCH = sparc64
101
	UARCH = sparc64
101
	UARCH = sparc64
102
	BARCH = sparc64
102
	BARCH = sparc64
103
endif
103
endif
104
 
104
 
105
ifeq ($(PLATFORM),ia32xen)
105
ifeq ($(PLATFORM),ia32xen)
106
	KARCH = ia32xen
106
	KARCH = ia32xen
107
	UARCH = ia32
107
	UARCH = ia32
108
	BARCH = ia32xen
108
	BARCH = ia32xen
109
endif
109
endif
110
 
110
 
111
.PHONY: all build config distclean clean cscope
111
.PHONY: all build config distclean clean cscope
112
 
112
 
113
all:
113
all:
114
	tools/config.py HelenOS.config default $(PLATFORM) $(COMPILER) $(CONFIG_DEBUG)
114
	tools/config.py HelenOS.config default $(PLATFORM) $(COMPILER) $(CONFIG_DEBUG)
115
	$(MAKE) -C . build
115
	$(MAKE) -C . build
116
 
116
 
117
build:
117
build:
118
ifneq ($(MACHINE),)
118
ifneq ($(MACHINE),)
119
	$(MAKE) -C kernel ARCH=$(KARCH) COMPILER=$(COMPILER) CONFIG_DEBUG=$(CONFIG_DEBUG) MACHINE=$(MACHINE)
119
	$(MAKE) -C kernel ARCH=$(KARCH) COMPILER=$(COMPILER) CONFIG_DEBUG=$(CONFIG_DEBUG) MACHINE=$(MACHINE)
120
else
120
else
121
	$(MAKE) -C kernel ARCH=$(KARCH) COMPILER=$(COMPILER) CONFIG_DEBUG=$(CONFIG_DEBUG)
121
	$(MAKE) -C kernel ARCH=$(KARCH) COMPILER=$(COMPILER) CONFIG_DEBUG=$(CONFIG_DEBUG) NETWORKING=$(NETWORKING)
122
endif
122
endif
123
	$(MAKE) -C uspace ARCH=$(UARCH) COMPILER=$(COMPILER) CONFIG_DEBUG=$(CONFIG_DEBUG) NETWORKING=$(NETWORKING)
123
	$(MAKE) -C uspace ARCH=$(UARCH) COMPILER=$(COMPILER) CONFIG_DEBUG=$(CONFIG_DEBUG) NETWORKING=$(NETWORKING)
124
ifneq ($(IMAGE),)
124
ifneq ($(IMAGE),)
125
	$(MAKE) -C boot ARCH=$(BARCH) COMPILER=$(COMPILER) CONFIG_DEBUG=$(CONFIG_DEBUG) NETWORKING=$(NETWORKING) IMAGE=$(IMAGE)
125
	$(MAKE) -C boot ARCH=$(BARCH) COMPILER=$(COMPILER) CONFIG_DEBUG=$(CONFIG_DEBUG) NETWORKING=$(NETWORKING) IMAGE=$(IMAGE)
126
else
126
else
127
	$(MAKE) -C boot ARCH=$(BARCH) COMPILER=$(COMPILER) CONFIG_DEBUG=$(CONFIG_DEBUG) NETWORKING=$(NETWORKING)
127
	$(MAKE) -C boot ARCH=$(BARCH) COMPILER=$(COMPILER) CONFIG_DEBUG=$(CONFIG_DEBUG) NETWORKING=$(NETWORKING)
128
endif
128
endif
129
 
129
 
130
config:
130
config:
131
	tools/config.py HelenOS.config
131
	tools/config.py HelenOS.config
132
 
132
 
133
distclean:
133
distclean:
134
	-$(MAKE) -C kernel distclean
134
	-$(MAKE) -C kernel distclean
135
	-$(MAKE) -C uspace distclean
135
	-$(MAKE) -C uspace distclean
136
	-$(MAKE) -C boot distclean
136
	-$(MAKE) -C boot distclean
137
	rm -f Makefile.config tools/*.pyc
137
	rm -f Makefile.config tools/*.pyc
138
 
138
 
139
clean:
139
clean:
140
	-$(MAKE) -C kernel clean
140
	-$(MAKE) -C kernel clean
141
	-$(MAKE) -C uspace clean
141
	-$(MAKE) -C uspace clean
142
	-$(MAKE) -C boot clean
142
	-$(MAKE) -C boot clean
143
 
143
 
144
cscope:
144
cscope:
145
	find kernel boot uspace -regex '^.*\.[chsS]$$' -print > srclist
145
	find kernel boot uspace -regex '^.*\.[chsS]$$' -print > srclist
146
	rm -f cscope.out
146
	rm -f cscope.out
147
	cscope -bi srclist
147
	cscope -bi srclist
148
 
148