Makefile.kmk revision 19db5308586c82eb3ae0018d326978a1cee325af
# $Id$
## @file
# Makefile for the IPRT (IPRT).
#
#
# Copyright (C) 2006-2007 Sun Microsystems, Inc.
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# you can redistribute it and/or modify it under the terms of the GNU
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#
# The contents of this file may alternatively be used under the terms
# of the Common Development and Distribution License Version 1.0
# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
# VirtualBox OSE distribution, in which case the provisions of the
# CDDL are applicable instead of those of the GPL.
#
# You may elect to license modified versions of this file under the
# terms and conditions of either the GPL or the CDDL or both.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
# Clara, CA 95054 USA or visit http://www.sun.com if you need
# additional information or have any questions.
#
DEPTH = ../../..
include $(PATH_KBUILD)/header.kmk
ifdef VBOX_ONLY_ADDITIONS
#
# Only build the additions, sort out the legacy names first.
#
ifeq ($(BUILD_TARGET),win)
LIBRARIES = RuntimeW32GuestR0 RuntimeW32GuestR3 RuntimeW32NT4GuestR0
else
LIBRARIES = RuntimeGuestR0 RuntimeGuestR3 RuntimeGuestR3Mini
#LIBRARIES.os2 = RuntimeOS2Warp3GuestR0
#LIBRARIES.win = RuntimeW32NT4GuestR0
ifndef VBOX_WITH_ADDITION_DRIVERS
if1of ($(BUILD_TARGET), linux l4) # All drivers are optional, can skip RuntimeGuestR0.
LIBRARIES := $(filter-out RuntimeGuestR0, $(LIBRARIES))
endif
endif
endif
else
#
# Normal build.
#
BLDPROGS = uniread
LIBRARIES = RuntimeR3 RuntimeR0 RuntimeGC RuntimeEFCPP RuntimeR3NoCRTGCC
ifdef VBOX_WITH_VBOXDRV
LIBRARIES += RuntimeR0Drv
endif
ifdef VBOX_WITH_ADDITIONS
ifdef VBOX_WITH_WIN32_ADDITIONS
LIBRARIES += RuntimeW32GuestR0 RuntimeW32GuestR3 RuntimeW32NT4GuestR0
endif
ifneq ($(BUILD_TARGET),win)
LIBRARIES += RuntimeGuestR0 RuntimeGuestR3 RuntimeGuestR3Mini
#LIBRARIES.os2 = RuntimeOS2Warp3GuestR0
#LIBRARIES.win = RuntimeW32NT4GuestR0
ifndef VBOX_WITH_ADDITION_DRIVERS
if1of ($(BUILD_TARGET), linux l4) # All drivers are optional, can skip RuntimeGuestR0.
LIBRARIES := $(filter-out RuntimeGuestR0, $(LIBRARIES))
endif
endif
endif
endif # VBOX_WITH_ADDITIONS
LIBRARIES.l4 = RuntimeR3L4 RuntimeLnxHostR3
DLLS = VBoxRT
OTHER_CLEAN = \
$(PATH_TARGET)/errmsgdata.h \
$(PATH_TARGET)/errmsgcomdata.h \
$(PATH_TARGET)/Doxyfile \
$(PATH_TARGET)/Doxyfile.dep \
$(PATH_TARGET)/docs.iprt
SUBDIRS_AFTER = testcase
endif
# global (for now at least)
INCS += include
#
# Unicode Specification reader used to regenerate unidata.cpp.
#
uniread_TEMPLATE = VBOXBLDPROG
uniread_SOURCES = common/string/uniread.cpp
#
# Win64 assembly sources.
#
RuntimeWin64ASM_SOURCES = \
#
# Win32 assembly sources.
#
RuntimeWin32ASM_SOURCES = \
#
# RuntimeR3 - Static Runtime for Ring-3 executables.
#
RuntimeR3_TEMPLATE = VBOXR3EXE
RuntimeR3_SDKS.win = WINPSDK W2K3DDK
RuntimeR3_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF32 LDR_WITH_PE RT_WITH_VBOX
ifdef IPRT_WITH_KSTUFF
RuntimeR3_DEFS += LDR_WITH_KLDR
endif
ifdef VBOX_MAIN_RELEASE_LOG ## @todo (dmik): temporary, until RTThreadSelf/RTThreadAdopt are properly updated
RuntimeR3_DEFS += RTCRITSECT_STRICT
endif
RuntimeR3_INCS = \
$(PATH_ROOT)/src/libs/liblzf-1.51
ifdef IPRT_WITH_KSTUFF
RuntimeR3_INCS += \
$(PATH_ROOT)/src/libs/kStuff/kStuff/include
endif
$(L4_INCDIR)
# for iconv.h
# RuntimeR3_INCS.solaris = \
RuntimeR3_SOURCES = \
#if1of ($(BUILD_TARGET_ARCH),amd64 x86)
# RuntimeR3_SOURCES += common/time/timesupA.asm
#else
RuntimeR3_SOURCES += common/time/timesupref.cpp
#endif
ifdef IPRT_WITH_KSTUFF
RuntimeR3_SOURCES += \
endif
# VBox specific stuff.
RuntimeR3_SOURCES += \
ifneq ($(BUILD_TARGET),win)
RuntimeR3_SOURCES += \
endif
RuntimeR3_SOURCES.win.amd64 = $(RuntimeWin64ASM_SOURCES)
RuntimeR3_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
ifdef RT_NEW_LINUX_MUTEX_CODE
else
endif
## @todo Make BSD sched.
## PORTME: Porters add their selection of platform specific files for Ring-3 here.
#
# L4 RuntimeR3 subtarget since L4 headers won't work with VBOXR3.
#
RuntimeR3L4_TEMPLATE = VBOXR3NP
RuntimeR3L4_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF LDR_WITH_PE
ifneq ($(BUILD_TARGET_ARCH),amd64)
RuntimeR3L4_DEFS += __PIC__
endif
RuntimeR3L4_INCS = $(L4_INCDIR)
RuntimeR3L4_SOURCES = \
#
# RuntimeGuestR3 - Guest Additions Runtime (static).
# (The BUILD_PLATFORM inheritance here is for l4 cross building the linux
# additions, while .x86 is for cross building x86 while targeting amd64.)
#
RuntimeGuestR3_TEMPLATE := VBOXGUESTR3LIB
RuntimeGuestR3_DEFS := $(filter-out RTCRITSECT_STRICT, $(RuntimeR3_DEFS))
RuntimeGuestR3_DEFS.$(BUILD_TARGET) := $(RuntimeR3_DEFS.$(BUILD_TARGET))
RuntimeGuestR3_DEFS.$(BUILD_PLATFORM) := $(RuntimeR3_DEFS.$(BUILD_PLATFORM))
RuntimeGuestR3_INCS := $(RuntimeR3_INCS)
RuntimeGuestR3_INCS.$(BUILD_TARGET) := $(RuntimeR3_INCS.$(BUILD_TARGET))
RuntimeGuestR3_INCS.$(BUILD_PLATFORM) := $(RuntimeR3_INCS.$(BUILD_PLATFORM))
RuntimeGuestR3_SOURCES := $(filter-out \
, $(RuntimeR3_SOURCES))
RuntimeGuestR3_SOURCES += \
RuntimeGuestR3_SOURCES.$(BUILD_TARGET) := $(RuntimeR3_SOURCES.$(BUILD_TARGET))
RuntimeGuestR3_SOURCES.$(BUILD_PLATFORM):= $(RuntimeR3_SOURCES.$(BUILD_PLATFORM))
RuntimeGuestR3_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH) := $(RuntimeR3_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH))
RuntimeGuestR3_SOURCES.$(BUILD_PLATFORM).$(BUILD_TARGET_ARCH) := $(RuntimeR3_SOURCES.$(BUILD_PLATFORM).$(BUILD_TARGET_ARCH))
RuntimeGuestR3_SOURCES.$(BUILD_TARGET).x86 := $(RuntimeR3_SOURCES.$(BUILD_TARGET).x86)
RuntimeGuestR3_SOURCES.$(BUILD_PLATFORM).x86 := $(RuntimeR3_SOURCES.$(BUILD_PLATFORM).x86)
#
# RuntimeGuestR3Mini - Minimal Guest Additions Runtime which does not require
# initialization and can be linked into an .so. Intended
# for X11 drivers, GRADD and similar.
#
RuntimeGuestR3Mini_TEMPLATE := VBOXGUESTR3DLL
RuntimeGuestR3Mini_INST := $(INST_ADDITIONS_LIB)
RuntimeGuestR3Mini_DEFS := $(filter-out RTCRITSECT_STRICT, $(RuntimeR3_DEFS)) RT_MINI
RuntimeGuestR3Mini_DEFS.$(BUILD_TARGET) := $(RuntimeR3_DEFS.$(BUILD_TARGET))
RuntimeGuestR3Mini_DEFS.$(BUILD_PLATFORM) := $(RuntimeR3_DEFS.$(BUILD_PLATFORM))
RuntimeGuestR3Mini_INCS := $(RuntimeR3_INCS)
RuntimeGuestR3Mini_INCS.$(BUILD_TARGET) := $(RuntimeR3_INCS.$(BUILD_TARGET))
RuntimeGuestR3Mini_INCS.$(BUILD_PLATFORM) := $(RuntimeR3_INCS.$(BUILD_PLATFORM))
RuntimeGuestR3Mini_SOURCES = \
# VBox specific stuff.
RuntimeGuestR3Mini_SOURCES += \
#
# RuntimeW32GuestR3 - Win32 guest program runtime.
#
RuntimeW32GuestR3_TEMPLATE = VBOXW32GUESTR3LIB
RuntimeW32GuestR3_SDKS = WINPSDK W2K3DDK
RuntimeW32GuestR3_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF32 LDR_WITH_PE RT_WITH_VBOX
ifdef IPRT_WITH_KSTUFF
RuntimeW32GuestR3_DEFS += LDR_WITH_KLDR
endif
RuntimeW32GuestR3_SOURCES = $(RuntimeR3_SOURCES.win) $(RuntimeR3_SOURCES)
RuntimeW32GuestR3_INCS = $(RuntimeR3_INCS.win) $(RuntimeR3_INCS)
#
# RuntimeLnxHostR3 Linux host program runtime
#
RuntimeLnxHostR3_TEMPLATE = VBOXLNXHOSTR3LIB
RuntimeLnxHostR3_DEFS = IN_RT_R3 IN_SUP_R3 RT_WITH_VBOX RT_NO_GIP
RuntimeLnxHostR3_SOURCES = \
$(RuntimeR3_SOURCES.linux.$(BUILD_TARGET_ARCH)) \
$(RuntimeR3_SOURCES)
RuntimeLnxHostR3_INCS = \
$(RuntimeR3_INCS.linux.$(BUILD_TARGET_ARCH)) \
$(RuntimeR3_INCS.linux) \
$(RuntimeR3_INCS)
#
# VBoxRT - Shared Object / DLL version.
#
VBoxRT_TEMPLATE = VBOXR3
VBoxRT_SDKS.win = WINPSDK W2K3DDK VBOX_NTDLL
ifeq ($(BUILD_TARGET),darwin)
VBoxRT_INST = $(INST_DLL) $(INST_TESTCASE)
endif
VBoxRT_DEFS = $(RuntimeR3_DEFS) IN_SUP_R3 IN_SUP_R3
VBoxRT_DEFS.$(BUILD_TYPE) = $(RuntimeR3_DEFS.$(BUILD_TYPE))
VBoxRT_SOURCES = \
$(RuntimeR3_SOURCES)
VBoxRT_SOURCES.$(BUILD_TARGET) = $(RuntimeR3_SOURCES.$(BUILD_TARGET))
VBoxRT_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH) = $(RuntimeR3_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH))
VBoxRT_INCS = $(RuntimeR3_INCS)
VBoxRT_INCS.$(BUILD_TARGET) = $(RuntimeR3_INCS.$(BUILD_TARGET))
VBoxRT_INCS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH) = $(RuntimeR3_INCS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH))
VBoxRT_LIBS = \
$(PATH_LIB)/SUPR3$(VBOX_SUFF_LIB) \
$(PATH_LIB)/VBox-liblzf$(VBOX_SUFF_LIB)
ifdef IPRT_WITH_KSTUFF
VBoxRT_LIBS += \
$(PATH_LIB)/VBox-kStuff$(VBOX_SUFF_LIB)
endif
iconv
iconv
VBoxRT_LDFLAGS.darwin = -framework IOKit -install_name @executable_path/VBoxRT.dylib
ifdef VBOX_USE_VCC80
VBoxRT_LDFLAGS.win = /MANIFEST
endif
-Wl,-whole-archive \
$(PATH_LIB)/RuntimeR3L4$(VBOX_SUFF_LIB) \
-Wl,-no-whole-archive
ifeq ($(BUILD_TARGET),l4)
VBoxRT_LIBS += \
$(L4_LIBDIR)/libl4sys.a \
$(L4_LIBDIR)/libl4sys.p.a
endif
VBoxRT_LIBS.l4 = \
$(PATH_LIB)/RuntimeR3L4$(VBOX_SUFF_LIB)
#
# RuntimeR3NoCRTGCC - CRT replacement lib for VBoxREM.
# This is used together with VBoxRT.
#
RuntimeR3NoCRTGCC_TEMPLATE = VBOXNOCRTGCC
RuntimeR3NoCRTGCC_LIBSUFF = $(VBOX_SUFF_LIB)
RuntimeR3NoCRTGCC_SOURCES = \
\
\
\
#
# RuntimeR0 - Ring0 library for VMMR0.
#
RuntimeR0_TEMPLATE = VBOXR0
RuntimeR0_DEFS = IN_RT_R0 RT_WITH_VBOX RT_WITHOUT_NOCRT_WRAPPERS
RuntimeR0_SOURCES = \
#if1of ($(BUILD_TARGET_ARCH),amd64 x86)
# RuntimeR0_SOURCES += common/time/timesupA.asm
#else
RuntimeR0_SOURCES += common/time/timesupref.cpp
#endif
RuntimeR0_SOURCES.win.amd64 = $(RuntimeWin64ASM_SOURCES)
RuntimeR0_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
ifeq ($(filter-out darwin solaris freebsd,$(BUILD_TARGET)),)
RuntimeR0_SOURCES += \
endif
ifeq ($(BUILD_TARGET),l4)
RuntimeR0Drv_BLD_TRG = linux
RuntimeR0Drv_BLD_TRG_ARCH = x86
RuntimeR0Drv_BLD_TRG_CPU = i386
endif
#
# RuntimeR0Drv - Ring0 library for host drivers.
#
RuntimeR0Drv_TEMPLATE = VBOXR0DRV
RuntimeR0Drv_SDKS.win = W2K3DDK WINPSDKINCS
RuntimeR0Drv_INCS := $(PATH_SUB_CURRENT)
RuntimeR0Drv_DEFS = IN_RT_R0 RT_WITH_VBOX RT_WITHOUT_NOCRT_WRAPPERS
RuntimeR0Drv_DEFS.win = IN_SUP_R0
RuntimeR0Drv_DEFS.linux = MODULE KBUILD_MODNAME=KBUILD_STR\(vboxdrv\) KBUILD_BASENAME=KBUILD_STR\(vboxdrv\) IN_SUP_R0 # why is IN_SUP_R0 here? because!
RuntimeR0Drv_SOURCES = \
## @todo timer-r0drv-nt.cpp and assert-r0drv-nt.cpp
RuntimeR0Drv_SOURCES.win.amd64 = $(RuntimeWin64ASM_SOURCES)
RuntimeR0Drv_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
\
\
## PORTME: Porters create and add their selection of platform specific Ring-0 Driver files here.
#
# RuntimeGuestR0 - Guest driver runtime.
# This is almost the same as the RuntimeR0Drv, the main difference
# is in the backdoor logging and the lack of sup.h (which should be
# made irrelevant even for RuntimeR0Rdrv).
#
# TODO: RuntimeGuestR0_EXTENDS = RuntimeR0Drv (kBuild)
#
RuntimeGuestR0_TEMPLATE := VBOXGUESTR0LIB
RuntimeGuestR0_SDKS.win := W2K3DDKX86 WINPSDKINCS
RuntimeGuestR0_DEFS := $(RuntimeR0Drv_DEFS)
RuntimeGuestR0_DEFS.$(BUILD_TARGET) := $(RuntimeR0Drv_DEFS.$(BUILD_TARGET))
RuntimeGuestR0_INCS := $(PATH_SUB_CURRENT)
RuntimeGuestR0_INCS.$(BUILD_TARGET) := $(RuntimeR0Drv_INCS.$(BUILD_TARGET))
RuntimeGuestR0_SOURCES := $(filter-out generic/RTLogWriteUser-generic.cpp, $(RuntimeR0Drv_SOURCES))
RuntimeGuestR0_SOURCES += VBox/logbackdoor.cpp
RuntimeGuestR0_SOURCES.$(BUILD_TARGET) := $(RuntimeR0Drv_SOURCES.$(BUILD_TARGET))
RuntimeGuestR0_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH) := $(RuntimeR0Drv_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH))
ifdef VBOX_USE_VCC80
endif
RuntimeOS2GuestR0_TEMPLATE = VBOXOS2GUESTR0LIB
RuntimeOS2GuestR0_SOURCES = \
$(filter-out common/misc/assert.cpp generic/RTLogWriteUser-generic.cpp,$(RuntimeR0Drv_SOURCES)) \
#
# RuntimeW32GuestR0 - Win32 guest driver runtime.
#
RuntimeW32GuestR0_TEMPLATE = VBOXW32GUESTR0LIB
RuntimeW32GuestR0_SDKS = W2K3DDKX86 WINPSDKINCS
RuntimeW32GuestR0_INCS := $(PATH_SUB_CURRENT)
RuntimeW32GuestR0_DEFS = IN_RT_R0 RT_WITH_VBOX RT_WITHOUT_NOCRT_WRAPPERS IN_SUP_R0
RuntimeW32GuestR0_DEFS.$(BUILD_TARGET) =
RuntimeW32GuestR0_SOURCES = \
$(filter-out generic/RTLogWriteUser-generic.cpp,$(RuntimeR0Drv_SOURCES)) \
ifdef VBOX_USE_VCC80
## @todo use the .asm versions of these.
RuntimeW32GuestR0_SOURCES += \
endif
#
# RuntimeW32NT4GuestR0 - Win32 NT4 guest driver runtime.
#
RuntimeW32NT4GuestR0_TEMPLATE = VBOXW32GUESTR0LIB
RuntimeW32NT4GuestR0_SDKS = $(RuntimeW32GuestR0_SDKS)
RuntimeW32NT4GuestR0_DEFS = $(RuntimeW32GuestR0_DEFS) IPRT_TARGET_NT4
RuntimeW32NT4GuestR0_INCS = $(RuntimeW32GuestR0_INCS)
RuntimeW32NT4GuestR0_SOURCES = $(RuntimeW32GuestR0_SOURCES)
#
# RuntimeGC - Guest context library.
#
RuntimeGC_TEMPLATE = VBOXGC
RuntimeGC_DEFS = IN_RT_GC RT_WITH_VBOX RT_WITHOUT_NOCRT_WRAPPERS
RuntimeGC_SOURCES = \
#if1of ($(BUILD_TARGET_ARCH),amd64 x86)
# RuntimeGC_SOURCES += common/time/timesupA.asm
#else
RuntimeGC_SOURCES += common/time/timesupref.cpp
#endif
RuntimeGC_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
ifeq ($(VBOX_LDR_FMT32),lx)
RuntimeGC_SOURCES += os2/sys0.asm
endif
ifeq ($(filter-out darwin solaris freebsd,$(BUILD_TARGET)),)
RuntimeGC_SOURCES += \
endif
#
# Static library for new & delete for the electric fence.
#
RuntimeEFCPP_TEMPLATE = $(RuntimeR3_TEMPLATE)
RuntimeEFCPP_SDKS = $(RuntimeR3_SDKS)
RuntimeEFCPP_SDKS.$(BUILD_TARGET) = $(RuntimeR3_SDKS.$(BUILD_TARGET))
RuntimeEFCPP_DEFS = $(RuntimeR3_DEFS)
RuntimeEFCPP_DEFS.$(BUILD_TARGET) = $(RuntimeR3_DEFS.$(BUILD_TARGET))
RuntimeEFCPP_INCS = $(RuntimeR3_INCS)
RuntimeEFCPP_INCS.$(BUILD_TARGET) = $(RuntimeR3_INCS.$(BUILD_TARGET))
RuntimeEFCPP_SOURCES = r3/alloc-ef-cpp.cpp
#
# errmsg.cpp depends on a generated header.
#
common/err/errmsg.cpp_DEPS = $(PATH_TARGET)/errmsgdata.h
common/err/errmsg.cpp_INCS = $(PATH_TARGET)
win/errmsgwin.cpp_DEPS = $(PATH_TARGET)/errmsgcomdata.h
win/errmsgwin.cpp_INCS = $(PATH_TARGET)
# Generate the rules
include $(PATH_KBUILD)/footer.kmk
ifneq ($(wildcard /usr/bin/chcon),)
# this is needed for testcases executed at build time
## @todo Make a special installer tool that does this.
$(PATH_BIN)/VBoxRT.so:
$(INSTALL) $(TARGET_VBoxRT) $@
chcon -t texrel_shlib_t $@ || true
endif
#
# Generate the status code data.
#
$(PATH_TARGET)/errmsgdata.h: common/err/errmsg.sed $(DEPTH)/include/iprt/err.h $(DEPTH)/include/VBox/err.h
$(call MSG_GENERATE,,$@,$(filter %.h,$^))
$(QUIET)$(MKDIR) -p $(PATH_TARGET)
$(QUIET)$(REDIRECT) -wo $@ -- $(SED) -f $< $(filter %.h,$^)
## @todo r=bird: rename this to indicate that it's not only COM errors, but all win32/64 errors.
$(call MSG_GENERATE,,$@,$(filter %.h,$^))
$(QUIET)$(MKDIR) -p $(PATH_TARGET)
$(QUIET)$(REDIRECT) -wo $@ -- $(SED) -f $< $(filter %.h,$^)
$(PATH_TARGET)/errmsgxpcomdata.h: common/err/errmsgxpcom.sed $(DEPTH)/src/libs/xpcom18a4/xpcom/base/nsError.h
$(call MSG_GENERATE,,$@,$(filter %.h,$^))
$(QUIET)$(MKDIR) -p $(PATH_TARGET)
$(QUIET)$(REDIRECT) -wo $@ -- $(SED) -f $< $(filter %.h,$^)
#
# Aliases for .cpp.h files so we can more easily do syntax checking from the editor.
#
#
# Doxygen documentation.
#
DOXYGEN_INPUT_DIRS = \
$(PATH_ROOT)/include/iprt \
$(PATH_ROOT)/include/iprt/nocrt \
$(PATH_ROOT)/include/iprt/nocrt/x86 \
$(PATH_ROOT)/include/iprt/nocrt/amd64 \
VBox/ \
$(foreach dir, . r3 r0drv,\
$(dir) \
$(dir)/darwin \
$(dir)/l4 \
$(dir)/linux \
$(dir)/nt \
$(dir)/os2 \
$(dir)/win \
$(dir)/win32 \
$(dir)/win64 \
$(dir)/generic \
)
# These must come first in order to make things look nice.
DOXYGEN_INPUT_FIRST =\
$(PATH_ROOT)/include/iprt/cdefs.h \
$(PATH_ROOT)/include/iprt/types.h \
$(PATH_ROOT)/include/iprt/runtime.h \
$(PATH_ROOT)/include/iprt/param.h \
$(PATH_ROOT)/include/iprt/assert.h \
$(PATH_ROOT)/include/iprt/asm.h \
DOXYGEN_INPUT := \
$(filter-out %.cpp.h, $(sort $(wildcard $(addsuffix /*.h, $(DOXYGEN_INPUT_DIRS)))) ) \
$(foreach dir, $(DOXYGEN_INPUT_DIRS), $(wildcard $(dir)/*.cpp $(dir)/.c $(dir)/.asm))
DOXYGEN_INPUT := \
$(DOXYGEN_INPUT_FIRST) \
$(filter-out $(DOXYGEN_INPUT_FIRST), $(DOXYGEN_INPUT))
DOXYGEN_OUTPUT = $(PATH_OUT)/docs/iprt
-include $(PATH_TARGET)/Doxyfile.dep
# Generate the Doxyfile
$(PATH_TARGET)/Doxyfile: Doxyfile Makefile.kmk \
$(comp-vars DOXYGEN_INPUT,DOXYGEN_INPUT_PREV,FORCE) \
$(comp-vars DOXYGEN_OUTPUT,DOXYGEN_OUTPUT_PREV,FORCE) \
| $(call DIRDEP, $(PATH_TARGET))
$(RM) -f $@ $@.tmp $(PATH_TARGET)/Doxyfile.dep
$(CP) -f Doxyfile $@.tmp
$(APPEND) $@.tmp
$(APPEND) $@.tmp "OUTPUT_DIRECTORY = $(DOXYGEN_OUTPUT)"
$(APPEND) $@.tmp "WARN_LOGFILE = $(DOXYGEN_OUTPUT)/errors"
$(APPEND) $@.tmp "INCLUDE_PATH = $(PATH_ROOT)/include include . common/table"
$(APPEND) $@.tmp "INCLUDE_FILE_PATTERNS = *.cpp.h"
$(APPEND) $@.tmp "PREDEFINED += $(ARCH_BITS_DEFS)"
$(APPEND) $@.tmp
$(APPEND) $@.tmp "INPUT = $(DOXYGEN_INPUT)"
$(APPEND) $@.tmp
$(MV) -f $@.tmp $@
@$(APPEND) $(PATH_TARGET)/Doxyfile.dep "DOXYGEN_OUTPUT_PREV = $(DOXYGEN_OUTPUT)"
@$(APPEND) $(PATH_TARGET)/Doxyfile.dep "DOXYGEN_INPUT_PREV = $(DOXYGEN_INPUT)"
# Create the output directory.
$(call DIRDEP, $(DOXYGEN_OUTPUT)):
$(MKDIR) -p $@
# Do the actual job.
$(PATH_TARGET)/docs.iprt: $(PATH_TARGET)/Doxyfile $(DOXYGEN_INPUT) | $(call DIRDEP, $(DOXYGEN_OUTPUT))
$(RM) -f $(wildcard $(DOXYGEN_OUTPUT)/html/*) $(PATH_TARGET)/docs.iprt
doxygen $(PATH_TARGET)/Doxyfile
$(APPEND) $(PATH_TARGET)/docs.iprt
# alias
docs: $(PATH_TARGET)/docs.iprt
test:
@echo test-$(comp-vars DOXYGEN_OUTPUT,DOXYGEN_OUTPUT_PREV,FORCE)
@echo $(DOXYGEN_OUTPUT)
@echo $(DOXYGEN_OUTPUT_PREV)
@echo $(DOXYGEN_INPUT)