switch-coreboot/Makefile
Uwe Hermann 60dd8e3ff1 Add support for generating Doxygen-documentation via 'make doc'.
The output is in HTML format and will be stored in the doxygen/html
directory. You can enable more output formats (latex, RTF, ...)
in the config file, util/Doxyfile.LinuxBIOS.

The current config options seem pretty reasonable to me, but we can
adapt them further to our needs, if required.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@171 f3766cd6-281f-0410-b1cd-43a5c92072e9
2007-03-02 15:03:02 +00:00

121 lines
2.9 KiB
Makefile

##
## This file is part of the LinuxBIOS project.
##
## LinuxBIOS build system Lbuild
##
## Copyright (C) 2007 coresystems GmbH
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
VERSION = 3
PATCHLEVEL = 0
SUBLEVEL = 0
ARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/sun4u/sparc64/ \
-e s/arm.*/arm/ -e s/sa110/arm/ \
-e s/s390x/s390/ -e s/parisc64/parisc/ \
-e s/ppc.*/powerpc/ -e s/mips.*/mips/ )
KERNELVERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)
have_dotconfig := $(wildcard .config)
src:=$(shell pwd)
obj:=$(shell pwd)/lbobj
# Do not print "Entering directory ..."
MAKEFLAGS += --no-print-directory
CC := gcc
CFLAGS := -Os -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-Werror-implicit-function-declaration \
-fno-strict-aliasing -fno-common \
-ffreestanding -fno-builtin
HOSTCC := gcc
HOSTCXX := g++
HOSTCFLAGS := -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \
-Wno-unused -Wno-sign-compare -Wno-pointer-sign
LINUXBIOSINCLUDE := -I$(src) -Iinclude \
-I$(src)/include \
-I$(src)/include/cpu/generic/$(ARCH)/ \
-include $(obj)/config.h
DOXYGEN := doxygen
DOXYGEN_OUTPUT_DIR := doxygen
# make is silent per default. make V=1 will show all compiler calls.
ifneq ($(V),1)
Q := @
endif
CPPFLAGS := $(LINUXBIOSINCLUDE)
CFLAGS += $(LINUXBIOSINCLUDE)
export src obj KERNELVERSION
ifeq ($(strip $(have_dotconfig)),)
all:
$(Q)echo "Please run make menuconfig, xconfig or config first."
else
include $(src)/.config
all: prepare prepare2 $(obj)/linuxbios.rom
$(Q)echo "Build process finished."
MAINBOARDDIR=$(shell echo $(CONFIG_MAINBOARD_NAME))
include lib/Makefile
include device/Makefile
include console/Makefile
include mainboard/$(MAINBOARDDIR)/Makefile
include arch/$(ARCH)/Makefile
endif
include util/Makefile
doc:
$(DOXYGEN) util/Doxyfile.LinuxBIOS
prepare:
$(Q)mkdir -p $(obj)
prepare2:
$(Q)cp $(src)/.tmpconfig.h $(obj)/config.h
clean:
$(Q)echo -n "Cleaning up... "
$(Q)rm -rf $(obj)
$(Q)rm -rf $(DOXYGEN_OUTPUT_DIR)
$(Q)echo "done"
distclean: clean
$(Q)echo -n "Deleting config files... "
$(Q)rm -f .kconfig.d .config .tmpconfig.h .config.old
$(Q)echo "done"
%.o: %.c
$(Q)echo "Compiling $<"
$(Q)$(CC) $(CFLAGS) -o $@ -c $<
.PHONY: doc