# -*- Makefile -*- # # DROPS (Dresden Realtime OPerating System) Component # # Makefile-Template for idl directories # # $Id: idl.mk 240 2007-11-27 03:55:44Z l4check $ # # $Author: l4check $ # # install.inc is used, see there for further documentation # - from install.inc, we use the feature to install files # to the local install directory on 'all' target. # Therefore, we set INSTALLDIR_LOCAL and INSTALLFILE_LOCAL. # Note that we changed INSTALLDIR_IDL_LOCAL AND INSTALLDIR_IDL # binary.inc is used, see there for further documentation ifeq ($(origin _L4DIR_MK_IDL_MK),undefined) _L4DIR_MK_IDL_MK=y ROLE = idl.mk DICE_REQ := --require="3.2.0" # define LOCAL_INSTALLDIR prior to including install.inc, where the install- # rules are defined. Same for INSTALLDIR. INSTALLDIR_IDL ?= $(DROPS_STDDIR)/include/$(ARCH)/$(L4API)/$(INSTALL_INC_PREFIX) INSTALLDIR_IDL_LOCAL ?= $(OBJ_BASE)/include/$(ARCH)/$(L4API)/$(INSTALL_INC_PREFIX) INSTALLFILE_IDL ?= $(INSTALL) -m 644 $(1) $(2) INSTALLFILE_IDL_LOCAL ?= $(LN) -sf $(call absfilename,$(1)) $(2) INSTALLFILE = $(INSTALLFILE_IDL) INSTALLDIR = $(INSTALLDIR_IDL) INSTALLFILE_LOCAL = $(INSTALLFILE_IDL_LOCAL) INSTALLDIR_LOCAL = $(INSTALLDIR_IDL_LOCAL) INSTALL_INC_PREFIX ?= l4/$(PKGNAME) # our default MODE is 'l4env' MODE ?= l4env IDL_EXPORT_STUB ?= % IDL_EXPORT_IDL ?= % include $(L4DIR)/mk/Makeconf include $(L4DIR)/mk/binary.inc $(GENERAL_D_LOC): $(L4DIR)/mk/idl.mk ifneq ($(SYSTEM),) # if we have a system, really build ####################################################### # # SYSTEM valid, we are in an OBJ- system subdir # ####################################################### IDL_EXPORT_STUB ?= % IDL_TYPE ?= dice # C++ specific rules IDL_C = c IDL_H = h IDL_CPP = $(CC) ifneq (,$(findstring BmCPP,$(IDL_FLAGS))) IDL_C = cc IDL_H = hh IDL_CPP = $(CXX) else ifneq (,$(findstring Bmcpp,$(IDL_FLAGS))) IDL_C = cc IDL_H = hh IDL_CPP = $(CXX) endif endif IDL_DEP = $(addprefix .,$(addsuffix .d,$(notdir $(IDL)))) IDL_SKELETON_C = $(IDL:.idl=-server.$(IDL_C)) IDL_SKELETON_H = $(IDL_SKELETON_C:.$(IDL_C)=.$(IDL_H)) IDL_STUB_C = $(IDL:.idl=-client.$(IDL_C)) IDL_STUB_H = $(IDL_STUB_C:.$(IDL_C)=.$(IDL_H)) IDL_OPCODE_H = $(IDL:.idl=-sys.$(IDL_H)) IDL_FILES = $(IDL_SKELETON_C) $(IDL_SKELETON_H) $(IDL_STUB_C) $(IDL_STUB_H) \ $(IDL_OPCODE_H) # Makro that expands to the list of generated files # arg1 - name of the idl file. Path and extension will be stripped IDL_FILES_EXPAND = $(addprefix $(notdir $(basename $(1))),-server.$(IDL_C) -server.$(IDL_H) -client.$(IDL_C) -client.$(IDL_H) -sys.$(IDL_H)) INSTALL_TARGET = $(patsubst %.idl,%-sys.$(IDL_H), \ $(filter $(IDL_EXPORT_SKELETON) $(IDL_EXPORT_STUB),$(IDL)))\ $(patsubst %.idl,%-server.$(IDL_H), \ $(filter $(IDL_EXPORT_SKELETON),$(IDL))) \ $(patsubst %.idl,%-client.$(IDL_H), \ $(filter $(IDL_EXPORT_STUB), $(IDL))) all:: $(IDL_FILES) .DELETE_ON_ERROR: # the dependencies for the generated files DEPS += $(IDL_DEP) ifneq (,$(filter-out corba dice, $(IDL_TYPE))) $(error IDL_TYPE is neither nor ) endif # the IDL file is found one directory up vpath %.idl $(SRC_DIR) # DICE mode IDL_FLAGS += $(addprefix -P,$(CPPFLAGS)) IDL_FLAGS += $(IDL_FLAGS_$(>.$(>.$(