0,0 → 1,152 |
# |
# Copyright (C) 2006 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - Redistributions in binary form must reproduce the above copyright |
# notice, this list of conditions and the following disclaimer in the |
# documentation and/or other materials provided with the distribution. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
# |
|
## Include configuration |
# |
|
-include Makefile.config |
|
## Setup platform configuration |
# |
|
ifeq ($(PLATFORM),amd64) |
KARCH = amd64 |
MACHINE = opteron |
UARCH = amd64 |
BARCH = amd64 |
endif |
|
ifeq ($(PLATFORM),ia32) |
KARCH = ia32 |
UARCH = ia32 |
BARCH = ia32 |
endif |
|
ifeq ($(PLATFORM),ia64) |
KARCH = ia64 |
UARCH = ia64 |
BARCH = ia64 |
endif |
|
ifeq ($(PLATFORM),mips32msim) |
KARCH = mips32 |
MACHINE = msim |
UARCH = mips32 |
BARCH = mips32 |
IMAGE = binary |
endif |
|
ifeq ($(PLATFORM),mips32sim) |
KARCH = mips32 |
MACHINE = simics |
UARCH = mips32 |
BARCH = mips32 |
IMAGE = ecoff |
endif |
|
ifeq ($(PLATFORM),mips32gbe) |
KARCH = mips32 |
MACHINE = bgxemul |
UARCH = mips32eb |
BARCH = mips32 |
IMAGE = ecoff |
endif |
|
ifeq ($(PLATFORM),mips32gle) |
KARCH = mips32 |
MACHINE = lgxemul |
UARCH = mips32 |
BARCH = mips32 |
IMAGE = ecoff |
endif |
|
ifeq ($(PLATFORM),mips32sgi) |
KARCH = mips32 |
MACHINE = indy |
UARCH = mips32eb |
BARCH = mips32 |
IMAGE = ecoff |
endif |
|
ifeq ($(PLATFORM),ppc32) |
KARCH = ppc32 |
UARCH = ppc32 |
BARCH = ppc32 |
endif |
|
ifeq ($(PLATFORM),ppc64) |
KARCH = ppc64 |
UARCH = ppc64 |
BARCH = ppc64 |
endif |
|
ifeq ($(PLATFORM),sparc64) |
KARCH = sparc64 |
UARCH = sparc64 |
BARCH = sparc64 |
endif |
|
ifeq ($(PLATFORM),xen32) |
KARCH = xen32 |
UARCH = ia32 |
BARCH = xen32 |
endif |
|
.PHONY: all build config distclean clean |
|
all: |
tools/config.py HelenOS.config default |
$(MAKE) -C . build |
|
build: |
ifneq ($(MACHINE),) |
$(MAKE) -C kernel ARCH=$(KARCH) COMPILER=$(COMPILER) CONFIG_DEBUG=$(CONFIG_DEBUG) MACHINE=$(MACHINE) |
else |
$(MAKE) -C kernel ARCH=$(KARCH) COMPILER=$(COMPILER) CONFIG_DEBUG=$(CONFIG_DEBUG) |
endif |
$(MAKE) -C uspace ARCH=$(UARCH) COMPILER=$(COMPILER) CONFIG_DEBUG=$(CONFIG_DEBUG) |
ifneq ($(IMAGE),) |
$(MAKE) -C boot ARCH=$(BARCH) COMPILER=$(COMPILER) CONFIG_DEBUG=$(CONFIG_DEBUG) IMAGE=$(IMAGE) |
else |
$(MAKE) -C boot ARCH=$(BARCH) COMPILER=$(COMPILER) CONFIG_DEBUG=$(CONFIG_DEBUG) |
endif |
|
config: |
-rm Makefile.depend HelenOS.config |
tools/config.py |
|
distclean: |
-rm Makefile.config |
-$(MAKE) -C kernel distclean |
-$(MAKE) -C uspace distclean |
-$(MAKE) -C boot distclean |
|
clean: |
-$(MAKE) -C kernel clean |
-$(MAKE) -C uspace clean |
-$(MAKE) -C boot clean |