Cleanup kconsole.c
[helenos.git] / Makefile
blob84511bac38aab1db54ad41b63c231d69def20558
2 # Copyright (c) 2006 Martin Decky
3 # All rights reserved.
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
7 # are met:
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.
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.
29 ## Include configuration
32 -include Makefile.config
34 ## Setup platform configuration
37 ifeq ($(PLATFORM),amd64)
38 KARCH = amd64
39 MACHINE = opteron
40 UARCH = amd64
41 BARCH = amd64
42 endif
44 ifeq ($(PLATFORM),ia32)
45 KARCH = ia32
46 UARCH = ia32
47 BARCH = ia32
48 endif
50 ifeq ($(PLATFORM),ia64)
51 KARCH = ia64
52 UARCH = ia64
53 BARCH = ia64
54 endif
56 ifeq ($(PLATFORM),mips32)
57 KARCH = mips32
58 BARCH = mips32
60 ifeq ($(MACHINE),msim)
61 UARCH = mips32
62 IMAGE = binary
63 endif
65 ifeq ($(MACHINE),simics)
66 UARCH = mips32
67 IMAGE = ecoff
68 endif
70 ifeq ($(MACHINE),bgxemul)
71 UARCH = mips32eb
72 IMAGE = ecoff
73 endif
75 ifeq ($(MACHINE),lgxemul)
76 UARCH = mips32
77 IMAGE = ecoff
78 endif
80 ifeq ($(MACHINE),indy)
81 UARCH = mips32eb
82 IMAGE = ecoff
83 endif
84 endif
86 ifeq ($(PLATFORM),ppc32)
87 KARCH = ppc32
88 UARCH = ppc32
89 BARCH = ppc32
90 endif
92 ifeq ($(PLATFORM),ppc64)
93 KARCH = ppc64
94 UARCH = ppc64
95 BARCH = ppc64
96 endif
98 ifeq ($(PLATFORM),sparc64)
99 KARCH = sparc64
100 UARCH = sparc64
101 BARCH = sparc64
102 endif
104 ifeq ($(PLATFORM),ia32xen)
105 KARCH = ia32xen
106 UARCH = ia32
107 BARCH = ia32xen
108 endif
110 .PHONY: all build config distclean clean
112 all:
113 tools/config.py HelenOS.config default $(PLATFORM) $(COMPILER) $(CONFIG_DEBUG)
114 $(MAKE) -C . build
116 build:
117 ifneq ($(MACHINE),)
118 $(MAKE) -C kernel ARCH=$(KARCH) COMPILER=$(COMPILER) CONFIG_DEBUG=$(CONFIG_DEBUG) MACHINE=$(MACHINE)
119 else
120 $(MAKE) -C kernel ARCH=$(KARCH) COMPILER=$(COMPILER) CONFIG_DEBUG=$(CONFIG_DEBUG)
121 endif
122 $(MAKE) -C uspace ARCH=$(UARCH) COMPILER=$(COMPILER) CONFIG_DEBUG=$(CONFIG_DEBUG)
123 ifneq ($(IMAGE),)
124 $(MAKE) -C boot ARCH=$(BARCH) COMPILER=$(COMPILER) CONFIG_DEBUG=$(CONFIG_DEBUG) IMAGE=$(IMAGE)
125 else
126 $(MAKE) -C boot ARCH=$(BARCH) COMPILER=$(COMPILER) CONFIG_DEBUG=$(CONFIG_DEBUG)
127 endif
129 config:
130 tools/config.py HelenOS.config
132 distclean:
133 -rm Makefile.config
134 -$(MAKE) -C kernel distclean
135 -$(MAKE) -C uspace distclean
136 -$(MAKE) -C boot distclean
138 clean:
139 -$(MAKE) -C kernel clean
140 -$(MAKE) -C uspace clean
141 -$(MAKE) -C boot clean