4 # DROPS (Dresden Realtime OPerating System) Component
6 # Make configuration file
8 # This file is included by all Makefile-templates. This file defines macros
9 # for div commands, sets general DROPS-Makefile variables, ensures the
10 # dependencies from the various Makeconf.locals, defines the messages for
11 # div actions, and permits the dependency-creation on clean-rules.
13 # The macros BUILD_MULTIPLE_ARCHITECTURES and BUILD_ONE_ARCHITECTURE are
16 # BUILD_MULTIPLE_ARCHITECTURES is set if ARCHS is set to multiple
17 # architectures in the Makefile. If ARCHS is not set, the default value
18 # l4_i386 will be assumed, not defining BUILD_MULTIPLE_ARCHITECTURES.
19 # In the muli-arch case, binary.inc triggers build the files into subdirs,
20 # dir-name is the architecture. Then, make is called recursively with ARCH
21 # set to one architecture.
23 # BUILD_ONE_ARCHITECTURE is set if ARCH contains one architecture, and we
24 # actually build files (in subdirs for multi-arch case, in the same dir in
25 # the single-arch case).
27 ifeq ($(origin _L4DIR_MK_MAKECONF),undefined)
32 # the default target is all
35 # make .general.d dependent on the role-file
36 $(if $(ROLE),$(OBJ_DIR)/.general.d: $(L4DIR)/mk/$(ROLE))
38 SYSTEM_TARGET_arm = arm-linux-
39 SYSTEM_TARGET_ppc32 = powerpc-linux-
40 SYSTEM_TARGET = $(SYSTEM_TARGET_$(ARCH))
42 CARCHFLAGS_amd64 = -mno-red-zone
44 LDFLAGS_amd64 += -m elf_x86_64 -z max-page-size=0x1000 -z common-page-size=0x1000
46 LD_EMULATION_CHOICE_amd64 = elf_x86_64
47 LD_EMULATION_CHOICE_arm = armelf armelf_linux_eabi
48 LD_EMULATION_CHOICE_ppc32 = elf32ppc
49 LD_EMULATION_CHOICE_x86 = elf_i386
51 OFORMAT_amd64 = elf64-x86-64
52 OFORMAT_arm = elf32-littlearm
53 OFORMAT_ppc32 = elf32-powerpc
54 OFORMAT_x86 = elf32-i386
55 OFORMAT = $(OFORMAT_$(ARCH))
59 BFD_ARCH_ppc32 = powerpc
61 BFD_ARCH = $(BFD_ARCH_$(ARCH))
63 L4_KIP_ADDR_amd64 ?= 0x6ffff000
64 L4_KIP_ADDR_arm ?= 0xaffff000
65 L4_KIP_ADDR_ppc32 ?= 0xaffff000
66 L4_KIP_ADDR_x86 ?= 0xaffff000
67 L4_KIP_ADDR ?= $(L4_KIP_ADDR_$(ARCH))
69 L4_KIP_OFFS_SYS_INVOKE = 0x800
70 L4_KIP_OFFS_SYS_DEBUGGER = 0x900
72 L4_STACK_ADDR_amd64 ?= 0x70000000
73 L4_STACK_ADDR_arm ?= 0xb0000000
74 L4_STACK_ADDR_ppc32 ?= 0xb0000000
75 L4_STACK_ADDR_x86 ?= 0xb0000000
76 L4_STACK_ADDR ?= $(L4_STACK_ADDR_$(ARCH))
77 L4_STACK_SIZE ?= $(if $(L4_STACK_SIZE_MAIN_THREAD),$(L4_STACK_SIZE_MAIN_THREAD),0x8000)
79 # This is quite bad: There is no other chance to disable the page-alignedment
80 # of the linker. The linker aligns the first section at 0x100000 for AMD64!
81 # We don't want this. Be careful for interactions with objcopy -S!
83 #LDFLAGS_amd64 += $(LDNMAGIC)
85 VERBOSE = $(if $(CONFIG_VERBOSE),,@)
86 DEPEND_VERBOSE = $(if $(CONFIG_DEPEND_VERBOSE),,@)
87 DROPS_STDDIR = $(patsubst "%",%,$(CONFIG_DROPS_STDDIR))
88 DROPS_INSTDIR = $(patsubst "%",%,$(CONFIG_DROPS_INSTDIR))
89 RAM_SIZE_MB = $(CONFIG_RAM_SIZE_MB)
90 RAM_BASE = $(CONFIG_RAM_BASE)
91 ARM_PLATFORM_TYPE= $(patsubst "%",%,$(CONFIG_ARM_PLATFORM_TYPE))
92 PPC_PLATFORM_TYPE= $(patsubst "%",%,$(CONFIG_PPC_PLATFORM_TYPE))
93 CPU = $(patsubst "%",%,$(CONFIG_CPU))
94 BUILD_ABI = $(patsubst "%",%,$(CONFIG_BUILD_ABI))
95 BUILD_ARCH = $(patsubst "%",%,$(CONFIG_BUILD_ARCH))
96 LABEL = $(patsubst "%",%,$(CONFIG_LABEL))
98 CARCHFLAGS_x86_586 = -march=i586
99 CARCHFLAGS_x86_pentium = -march=i586
100 CARCHFLAGS_x86_pentiummmx = -march=pentium-mmx
101 CARCHFLAGS_x86_pentiumpro = -march=pentiumpro
102 CARCHFLAGS_x86_686 = -march=i686
103 CARCHFLAGS_x86_pentium2 = -march=pentium2
104 CARCHFLAGS_x86_pentium3 = -march=pentium3
105 CARCHFLAGS_x86_pentiumm = -march=pentium-m
106 CARCHFLAGS_x86_pentium4 = -march=pentium4
107 CARCHFLAGS_x86_prescott = -march=prescott
108 CARCHFLAGS_x86_nocona = -march=nocona
109 CARCHFLAGS_x86_core2 = -march=core2
110 CARCHFLAGS_x86_K6 = -march=k6
111 CARCHFLAGS_x86_K7 = -march=athlon
112 CARCHFLAGS_x86_athlon4 = -march=athlon-4
113 CARCHFLAGS_x86_K8 = -march=k8
114 CARCHFLAGS_x86_opteron = -march=opteron
116 CARCHFLAGS_arm_armv4 = -march=armv4
117 CARCHFLAGS_arm_armv4t = -march=armv4t
118 CARCHFLAGS_arm_armv5 = -march=armv5
119 CARCHFLAGS_arm_armv5t = -march=armv5t
120 CARCHFLAGS_arm_armv5te = -march=armv5te
121 CARCHFLAGS_arm_armv6 = -march=armv6
122 CARCHFLAGS_arm_armv6t2 = -march=armv6t2
123 CARCHFLAGS_arm_armv6zk = -march=armv6zk
124 CARCHFLAGS_arm_armv7a = -march=armv7-a
125 CARCHFLAGS_arm_armv7r = -march=armv7-r
127 IDL_SYSTEMS = x86-l4f
129 CC_x86 = $(SYSTEM_TARGET)gcc -m32
130 CC_amd64 = $(SYSTEM_TARGET)gcc -m64
131 CC_arm = $(SYSTEM_TARGET)gcc
132 CC_ppc32 = $(SYSTEM_TARGET)gcc -m32
133 CXX_x86 = $(SYSTEM_TARGET)g++ -m32
134 CXX_amd64 = $(SYSTEM_TARGET)g++ -m64
135 CXX_arm = $(SYSTEM_TARGET)g++
136 CXX_ppc32 = $(SYSTEM_TARGET)g++ -m32
138 AR = $(SYSTEM_TARGET)ar
139 AS = $(SYSTEM_TARGET)as
141 CC = $(if $(USE_CCACHE),ccache) $(CC_$(BUILD_ARCH))
142 CXX = $(if $(USE_CCACHE),ccache) $(CXX_$(BUILD_ARCH))
144 DICE_SRCDIR ?= $(L4DIR)/../dice
145 DICE_OBJDIR ?= $(DICE_SRCDIR)
146 DICE = $(firstword $(wildcard $(DICE_OBJDIR)/src/dice \
147 $(DROPS_STDDIR)/tool/bin/dice \
148 $(shell which dice 2>/dev/null) ) \
149 did_not_find_dice___please_install_dice )
152 DICE_INCDIR ?= $(DICE_SRCDIR)/include
156 ELF_PATCHER = $(OBJ_BASE)/tool/elf-patcher/elf-patcher
158 GENOFFSETS = $(L4DIR)/tool/bin/genoffsets.pl
159 GOSH = $(firstword $(wildcard $(L4DIR)/../tools/gosh/gosh \
160 $(DROPS_STDDIR)/tool/bin/gosh \
161 $(shell which gosh 2>/dev/null) ) \
162 did_not_find_gosh___please_install_gosh )
167 LD = $(SYSTEM_TARGET)ld
170 GREP = GREP_OPTIONS= grep
173 MKFLAGS +=$(MKFLAGS_$@)
174 NM = $(SYSTEM_TARGET)nm
175 OBJCOPY = $(SYSTEM_TARGET)objcopy
176 PKG_CONFIG = pkg-config $(if $(VERBOSE),--silence-errors)
178 RANLIB = $(SYSTEM_TARGET)ranlib
180 SCRUB = $(RM) $(wildcard *.old) $(wildcard *~) $(wildcard *.bak) \
184 SIZE = $(SYSTEM_TARGET)size
185 STRIP = $(SYSTEM_TARGET)strip
188 GEN_DOPECODE = $(L4DIR)/tool/gen_dopecode/gen_dopecode
189 ABS2REL = $(L4DIR)/tool/bin/abs2rel.sh
190 # it's optional to be able to set it as environment variable
191 FIASCOUX ?= $(L4DIR)/../kernel/fiasco/build-ux/fiasco
193 DISASM_CMD ?= $(SYSTEM_TARGET)objdump -ld $(1) | $(PAGER)
194 IMAGES_DIR ?= $(OBJ_BASE)/images
197 # functions that are handy
198 absfilename_target_dir_needs_to_exist = $(foreach w,$(1),$(addsuffix /$(notdir $(w)),$(shell cd $(dir $(w)) 2>/dev/null&&$(PWDCMD))))
199 absfilename = $(shell $(L4DIR)/mk/rel2abs.sh $(1))
200 findfile = $(firstword $(wildcard $(addsuffix /$(1),$(2))) $(1)_NOT_FOUND)
201 is_dir = $(shell test -d '$(1)' && echo yes)
203 # include this one early to be able to set OBJ_BASE
204 -include $(L4DIR)/Makeconf.local
206 ifeq ($(filter $(IGNORE_OBJDIR_TARGETS),$(MAKECMDGOALS)),)
208 ifeq ($(O)$(OBJ_BASE),)
209 $(error need to give builddir with O=.../builddir)
212 ifeq ($(filter-out undefined environment,$(origin OBJ_BASE)),)
213 OBJ_BASE := $(call absfilename, $(O))
215 # prevent passing O to sub-makes, because it may be a relative path
218 MAKEOVERRIDES := $(filter-out O=%,$(MAKEOVERRIDES))
224 ifeq ($(origin L4DIR_ABS),undefined)
225 L4DIR_ABS := $(call absfilename,$(L4DIR))
227 ifeq ($(origin PKGDIR_ABS),undefined)
228 PKGDIR_ABS := $(call absfilename,$(PKGDIR))
230 ifeq ($(origin SRC_DIR),undefined)
231 SRC_DIR := $(shell pwd)
233 ifeq ($(origin SRC_BASE_ABS),undefined)
235 SRC_BASE_ABS := $(call absfilename,$(SRC_BASE))
238 ifeq ($(origin OBJ_DIR),undefined)
239 OBJ_DIR := $(subst $(SRC_BASE_ABS),$(OBJ_BASE),$(SRC_DIR))
241 ifeq ($(origin PKGDIR_OBJ),undefined)
242 PKGDIR_OBJ := $(call absfilename,$(OBJ_DIR)/$(PKGDIR))
245 # if PKGDIR is not in L4DIR, we have an external package, so make up some
247 ifneq ($(patsubst $(L4DIR_ABS)/%,,$(PKGDIR_ABS)),)
248 ifneq ($(filter-out $(OBJ_BASE)/ext-pkg%,$(PKGDIR_OBJ)),)
249 PKGDIR_OBJ := $(OBJ_BASE)/ext-pkg$(PKGDIR_OBJ)
250 OBJ_DIR := $(OBJ_BASE)/ext-pkg$(OBJ_DIR)
254 # sanity check the object dir
255 ifneq ($(SRC_BASE_ABS),$(OBJ_BASE))
256 ifeq ($(SRC_DIR),$(OBJ_DIR))
257 $(warning Sorry, your object or source path became garbled.)
258 $(warning OBJ_BASE: $(OBJ_BASE))
259 $(warning SRC_BASE_ABS: $(SRC_BASE_ABS))
260 $(warning SRC_DIR: $(SRC_DIR))
261 $(warning OBJ_DIR: $(OBJ_DIR))
262 $(warning PKGDIR: $(PKGDIR))
263 $(warning L4DIR_ABS: $(L4DIR_ABS))
264 $(warning PKGDIR_ABS: $(PKGDIR_ABS))
265 $(warning PKGDIR_OBJ: $(PKGDIR_OBJ))
266 $(error Please investigate.)
271 OBJ_DIR_EXPORT = $(OBJ_DIR)
272 export OBJ_DIR_EXPORT
274 VPATH_SRC_BASE ?= $(SRC_DIR)
276 # Makeconf.local handling
277 # dont use -include here, as we have special build conditions in $(L4DIR)/
278 ifeq ($(origin BID_ROOT_CONF),undefined)
279 BID_ROOT_CONF := $(call absfilename, $(OBJ_BASE))/.config.all
281 ifeq ($(filter $(IGNORE_OBJDIR_TARGETS),$(MAKECMDGOALS)),)
282 ifeq ($(wildcard $(BID_ROOT_CONF)),)
283 ifeq ($(BID_IGN_ROOT_CONF),)
284 $(error No configuration file found in build directory "$(OBJ_BASE)". Please run "make O=/path/to/objdir config" in "$(L4DIR_ABS)" or specify a valid build directory)
287 include $(BID_ROOT_CONF)
291 # if we're working on a program that wants the RAM_BASE be considered in its
292 # linking address, source a possible privately configured one
293 ifneq ($(RELOC_PHYS),)
294 -include $(OBJ_BASE)/Makeconf.ram_base
295 EXTRA_GENERAL_D_DEP += $(if $(wildcard $(OBJ_BASE)/Makeconf.ram_base),$(OBJ_BASE)/Makeconf.ram_base)
298 INCLUDE_MAKE_RULES += $(if $(LABEL),$(L4DIR)/Makeconf.$(LABEL))
300 ifneq ($(strip $(wildcard $(INCLUDE_MAKE_RULES))),)
301 -include $(wildcard $(INCLUDE_MAKE_RULES))
304 -include $(OBJ_BASE)/Makeconf.local
305 ifneq ($(PKGDIR_ABS),)
306 -include $(PKGDIR_ABS)/Makeconf.local
308 # if it is not already set, we use this in the local dir
309 MAKECONFLOCAL ?= Makeconf.local
310 -include $(MAKECONFLOCAL)
312 DROPS_STDDIR ?= /home/drops
313 ifeq ($(STATICFILE),)
314 STATICFILE = $(OBJ_BASE)/pkg/STATIC $(L4DIR)/pkg/STATIC
317 # a nasty workaround for make-3.79/make-3.80. The former needs an additional
318 # $$ for $-quotation when calling a function.
320 ifeq ($(call BID_IDENT,$$),)
331 ifeq ($(MODE_NOEXC),y)
335 include $(L4DIR)/mk/config.inc
337 ifneq ($(CONFIG_HAVE_LDSO),)
339 # arg1 - compiler binary name
340 # arg2 - [opt] compiler target. Will be written as target within the
342 # arg3 - [opt] name of the dependency file. If unset, .<arg2>.d will be used.
343 # arg4 - [opt] alternative binary name
344 ifeq ($(origin BID_LIBGENDEP_PATHS), undefined)
345 ifeq ($(HOST_SYSTEM),linux)
346 BID_LIBGENDEP_PATHS := \
347 $(firstword $(wildcard $(call absfilename, $(OBJ_BASE)/tool/gendep/64 \
348 $(DROPS_STDDIR)/tool/lib/64))):$(firstword $(wildcard $(call absfilename, \
349 $(OBJ_BASE)/tool/gendep/32 $(DROPS_STDDIR)/tool/lib/32 )))
352 ifeq ($(HOST_SYSTEM),darwin)
353 BID_LIBGENDEP_PATHS := \
354 $(firstword $(wildcard $(call absfilename, $(OBJ_BASE)/tool/gendep \
355 $(DROPS_STDDIR)/tool/lib)))
359 ifeq ($(HOST_SYSTEM),linux)
360 LD_GENDEP_PREFIX = LD_PRELOAD=libgendep.so LD_LIBRARY_PATH=$(if $(LD_LIBRARY_PATH),$(LD_LIBRARY_PATH):)$(BID_LIBGENDEP_PATHS)
362 ifeq ($(HOST_SYSTEM),darwin)
363 LD_GENDEP_PREFIX = DYLD_FORCE_FLAT_NAMESPACE=1 DYLD_INSERT_LIBRARIES=$(BID_LIBGENDEP_PATHS)/libgendep.so
365 MAKEDEP=$(LD_GENDEP_PREFIX) \
366 GENDEP_TARGET=$(if $(2),$(2),$@) \
367 GENDEP_BINARY=$(1) $(if $(3),GENDEP_DEPFILE=$(3)) \
368 $(if $(4),GENDEP_BINARY_ALT1=$(4))
371 # macros used here and in packages
372 checkcc = $(shell if $(CC) $(1) -o /dev/null -c -x c \
373 /dev/null > /dev/null 2>&1; then echo "$(1)"; fi)
374 checkcxx = $(shell if $(CXX) $(1) -o /dev/null -c -x c++ \
375 /dev/null > /dev/null 2>&1; then echo "$(1)"; fi)
377 # the gcc specific variables: version, base dir, include dir, gcc lib
378 # note: determining these variables is slow, and the values should
379 # be set in .config.all. However, this is the place were
380 # they are determined on a 'make config' in $(L4DIR)
381 GCCVERSION_f = $(shell $(CC) -dumpversion | sed -e 's/\(.*\)\..*/\1/')
382 GCCMAJORVERSION_f=$(shell $(CC) -dumpversion | sed -e 's/\([^.]*\).*/\1/')
383 GCCMINORVERSION_f=$(shell $(CC) -dumpversion | sed -e 's/[^.]*\.\([^.]*\).*/\1/')
384 GCCSUBVERSION_f = $(shell $(CC) -dumpversion | sed -e 's/.*\.\(.*\)/\1/')
385 LDVERSION_f = $(shell $(LD) -v | sed -e 's/.* \([0-9]\)\.\([^. ]*\).*/\1\2/')
386 GCCSYSLIBDIRS_f = $(shell LC_ALL=C $(CC) -print-search-dirs | sed '/^libraries:/{s/^libraries: /-L/;s/:/ -L/g;q;};d')
387 GCCDIR_f = $(shell LC_ALL=C $(CC) -print-search-dirs|sed -ne 's+^install: \(.*[^/][^/]*\)/+\1+p' )
388 GCCLIBDIR_f = $(shell LC_ALL=C $(CC) -print-file-name=)
389 GCCLIB_f = $(shell $(CC) -print-libgcc-file-name)
390 GCCLIB_EH_f = $(filter /%,$(shell $(CC) -print-file-name=libgcc_eh.a))
391 GCCINCDIR_f = $(addprefix $(call GCCDIR_f),/include /include-fixed)
392 GCCNOSTACKPROTOPT_f= $(call checkcc,-fno-stack-protector)
394 GCCINCDIR = $(GCCDIR)/include $(GCCDIR)/include-fixed
395 I_GCCINCDIR = $(addprefix -I,$(GCCINCDIR))
398 ifeq ($(origin PKGNAME),undefined)
399 PKGNAME := $(notdir $(shell cd $(PKGDIR);pwd))
414 ifeq ($(CONFIG_RELEASE_MODE),y)
415 DEFINES += -DL4BID_RELEASE_MODE
420 $(error RAM_BASE not given, needed for ARM architecture builds.)
426 ifneq ($(filter linux l4linux host,$(MODE)),)
431 # SUBDIR handling, not within the OBJ-*/ dirs
437 $(VERBOSE)PWD=$(PWD)/$@ $(MAKE) -C $@ all
439 # we know that SUBDIRS isn't empty, hence we can avoid the dir-test
440 scrub clean cleanall::
441 $(VERBOSE)set -e; $(foreach i,$(SUBDIRS), \
442 PWD=$(PWD)/$(i) $(MAKE) -C $(i) $@ $(MKFLAGS) $(MKFLAGS_$(i));)
445 $(VERBOSE)set -e; $(foreach i,$(SUBDIRS), \
446 PWD=$(PWD)/$(i) $(MAKE) -C $(i) $@ $(MKFLAGS) $(MKFLAGS_$(i));)
450 all:: $(OBJ_DIR)/Makefile
452 $(OBJ_DIR)/Makefile: $(L4DIR)/mk/Makeconf
453 $(VERBOSE)install -d $(dir $@)
454 $(VERBOSE)echo '# automatically created -- modifications will be lost' > $@
455 $(VERBOSE)echo 'SRC := $(SRC_DIR)' >> $@
456 $(VERBOSE)echo 'OBJ := $(OBJ_BASE)' >> $@
457 $(VERBOSE)echo '.PHONY: x $$(MAKECMDGOALS)' >> $@
458 $(VERBOSE)echo 'x:' >> $@
459 $(VERBOSE)echo ' @PWD=$$(SRC) $$(MAKE) -C $$(SRC) O=$$(OBJ)' >> $@
460 $(VERBOSE)echo '$$(MAKECMDGOALS):' >> $@
461 $(VERBOSE)echo ' @PWD=$$(SRC) $$(MAKE) -C $$(SRC) O=$$(OBJ) $$@'>> $@
464 # we are within an OBJ-*/ dir, create dummy target
473 # the general dependencies: All generated files depend on ".general.d".
474 # ".general.d" itself depends on the mk-Makeconf, the optional
475 # Makeconf.local, the .config.all, the packet-Makeconf.local and the
476 # Makeconf.local. This ensures a rebuilt if any of the configuration-
477 # or make-files changes.
479 # We have this nasty if-readable-magic to allow the files to disappear
480 # or to appear. Depending on if the according makeconf exists now, the
481 # if-readable magic .general.d is used on existance or non-existence.
483 BID_DEPEND_GENERAL_D_COND = \
484 if [ -r $(1) ] ; then echo -e '$@: $(1)\n$(1):\n' >>$@ ; \
485 else echo '$$(if $$(wildcard $(1)), $@: FORCE)' >>$@; fi
488 GENERAL_D_LOC := $(OBJ_DIR)/.general.d
490 GENERAL_D_LOC := .general.d
493 $(GENERAL_D_LOC): $(L4DIR)/mk/Makeconf $(EXTRA_GENERAL_D_DEP)
495 @install -d $(dir $@)
496 $(DEPEND_VERBOSE)echo '$@: $(SRC_DIR)/Makefile ' > $@
497 $(DEPEND_VERBOSE)$(call BID_DEPEND_GENERAL_D_COND,\
498 $(OBJ_BASE)/.config.all)
499 $(DEPEND_VERBOSE)$(call BID_DEPEND_GENERAL_D_COND,\
500 $(OBJ_BASE)/Makeconf.local)
501 $(DEPEND_VERBOSE)$(call BID_DEPEND_GENERAL_D_COND,\
502 $(L4DIR)/Makeconf.local)
503 $(DEPEND_VERBOSE)$(foreach m,$(wildcard $(INCLUDE_MAKE_RULES)),\
504 $(call BID_DEPEND_GENERAL_D_COND,$(m)); )
505 $(if $(PKGDIR_ABS),$(DEPEND_VERBOSE)$(call BID_DEPEND_GENERAL_D_COND,\
506 $(PKGDIR_ABS)/Makeconf.local))
507 $(DEPEND_VERBOSE)$(call BID_DEPEND_GENERAL_D_COND,\
510 DEPS += $(GENERAL_D_LOC)
517 # coloring on color-capable terminals
518 # enabled by setting CONFIG_BID_COLORED_PHASES to y
519 ifeq ($(CONFIG_BID_COLORED_PHASES),y)
520 ifeq ($(COLOR_TERMINAL),y)
521 EMPHSTART = '\033[34;1m'
529 AR_MESSAGE ?= echo -e " ==> Archiving into $@"
530 BUILD_MESSAGE ?= echo -e " ... Building $@"
531 BUILT_MESSAGE ?= echo -e $(EMPHSTART)' ==> "$@" built'$(EMPHSTOP)
532 COMP_MESSAGE ?= echo -e " ... Compiling $@"
533 COMP_P_MESSAGE ?= echo -e " ... Compiling PIC $@"
534 COMP_PR_MESSAGE ?= echo -e " ... Compiling PROFILE $@"
535 GEN_MESSAGE ?= echo -e " ... Generating $@"
536 LINK_MESSAGE ?= echo -e " ==> Linking $@"
537 LINK_SHARED_MESSAGE ?= echo -e " ==> Linking to shared $@"
538 LINK_PARTIAL_MESSAGE ?= echo -e " ==> Partial linking to $@"
539 DEP_MESSAGE ?= echo -e " ... Building dependencies for $<"
540 CLEAN_MESSAGE ?= echo -e " ... Removing created files"
541 CLEANALL_MESSAGE ?= echo -e " ... Removing all created files"
542 INSTALL_LINK_MESSAGE ?= echo -e " ==> Updating symlinks"
543 INSTALL_DOC_MESSAGE ?= echo -e " ==> Installing $(<) documentation"
544 INSTALL_DOC_LOCAL_MESSAGE ?= echo -e " ==> Installing $(<) documentation locally"
545 INSTALL_MESSAGE ?= echo -e " ==> Installing $^"
546 INSTALL_LOCAL_MESSAGE ?= echo -e " ==> Installing $(<) to local build-tree"
547 UPDATE_HTML_MESSAGE ?= echo -e " ! You should remake your doc directory in $(1)"
549 # allows an include $(DEPSVAR) at the end of the makefile
550 # but prevents rebuilding them on a scrub, clean, cleanall and help
551 ifneq ($(filter scrub clean cleanall help,$(MAKECMDGOALS)),)
561 # addfileheader-rule: allows "make addfileheader main.c server.c"-like
562 # commands and automatically inserts the path within the package
563 # options may be passed with $(ADDFILEHEADER_OPTIONS)
564 ADDFILEHEADER_PREFIX = $(patsubst $(call absfilename,$(PKGDIR)/)%,\
565 $(PKGNAME)/%,$(call absfilename,./))
566 ADDFILEHEADER_FILES = $(filter-out addfileheader,$(MAKECMDGOALS))
568 addfileheader $(ADDFILEHEADER_OPTIONS) -p $(ADDFILEHEADER_PREFIX) $(ADDFILEHEADER_FILES)
579 # 3: inc path (one only)
583 mkdir -p $(dir $(2)) \
585 $(if $(3),;echo "incdir=/empty_incdir" >> $(2)) \
586 ;echo "Name: $(1)" >> $(2) \
587 ;echo "Version: 0" >> $(2) \
588 ;echo "Description: L4 library" >> $(2) \
589 $(if $(3),;echo "Cflags: $(addprefix -I\$${incdir}/,$(3))" >> $(2)) \
590 $(if $(4),;echo "Libs: $(sort $(4))" >> $(2)) \
591 $(if $(5),;echo "Requires: $(5)" >> $(2)) \
592 $(if $(BID_GEN_CONTROL),;echo "Provides: $(1)" >> $(PKGDIR)/Control) \
593 $(if $(BID_GEN_CONTROL),;echo "Requires: $(5)" >> $(PKGDIR)/Control) ;
596 endif # _L4DIR_MK_MAKECONF undefined