summaryrefslogtreecommitdiff
path: root/libdde_linux26/mk/Makeconf
blob: fa6474ae300ff49dd75fd383d6ee82523f56115b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
# -*- Makefile -*-
# vim:set ft=make:
#
# DROPS (Dresden Realtime OPerating System) Component
#
# Make configuration file
#
# $Id: Makeconf 418 2008-11-12 03:50:31Z l4check $
#
# $Author: l4check $
#
# This file is included by all Makefile-templates. This file defines macros
# for div commands, sets general DROPS-Makefile variables, ensures the
# dependencies from the various Makeconf.locals, defines the messages for
# div actions, and permits the dependency-creation on clean-rules.
#
# The macros BUILD_MULTIPLE_ARCHITECTURES and BUILD_ONE_ARCHITECTURE are
# defined here.
#
# BUILD_MULTIPLE_ARCHITECTURES is set if ARCHS is set to multiple
# architectures in the Makefile. If ARCHS is not set, the default value
# l4_i386 will be assumed, not defining BUILD_MULTIPLE_ARCHITECTURES.
# In the muli-arch case, binary.inc triggers build the files into subdirs,
# dir-name is the architecture. Then, make is called recursively with ARCH
# set to one architecture.
#
# BUILD_ONE_ARCHITECTURE is set if ARCH contains one architecture, and we
# actually build files (in subdirs for multi-arch case, in the same dir in
# the single-arch case).

ifeq ($(origin _L4DIR_MK_MAKECONF),undefined)
_L4DIR_MK_MAKECONF=y

SYSTEMS = x86-l4v2
ARCH = x86

# the default target is all
all::

# make .general.d dependent on the role-file
$(if $(ROLE),$(OBJ_DIR)/.general.d: $(L4DIR)/mk/$(ROLE))

SYSTEM_TARGET	  = $(SYSTEM_TARGET_$(ARCH))
SYSTEM_TARGET_arm = arm-linux-

CARCHFLAGS_amd64  = -mno-red-zone
ASFLAGS_amd64     = -m64

LD_EMULATION_amd64= elf_x86_64
LD_EMULATION_arm  = armelf
LD_EMULATION_x86  = elf_i386
LD_EMULATION      = $(LD_EMULATION_$(ARCH))

OFORMAT_amd64     = elf64-x86-64
OFORMAT_arm       = default
OFORMAT_x86       = elf32-i386
OFORMAT           = $(OFORMAT_$(ARCH))

# This is quite bad: There is no other chance to disable the page-alignedment
# of the linker. The linker aligns the first section at 0x100000 for AMD64!
# We don't want this. Be careful for interactions with objcopy -S!
LDNMAGIC           ?= -n
LDFLAGS_amd64      += $(LDNMAGIC)

CARCHFLAGS_x86_586        = -march=i586
CARCHFLAGS_x86_pentium    = -march=i586
CARCHFLAGS_x86_pentiummmx = -march=pentium-mmx
CARCHFLAGS_x86_pentiumpro = -march=pentiumpro
CARCHFLAGS_x86_686        = -march=i686
CARCHFLAGS_x86_pentium2   = -march=pentium2
CARCHFLAGS_x86_pentium3   = -march=pentium3
CARCHFLAGS_x86_pentiumm   = -march=pentium-m
CARCHFLAGS_x86_pentium4   = -march=pentium4
CARCHFLAGS_x86_prescott   = -march=prescott
CARCHFLAGS_x86_nocona     = -march=nocona
CARCHFLAGS_x86_K6         = -march=k6
CARCHFLAGS_x86_K7         = -march=athlon
CARCHFLAGS_x86_athlon4    = -march=athlon-4
CARCHFLAGS_x86_K8         = -march=k8
CARCHFLAGS_x86_opteron    = -march=opteron

IDL_SYSTEMS 	= x86-l4v2

AR		= $(SYSTEM_TARGET)ar
AS		= $(SYSTEM_TARGET)as
AWKP		= gawk --posix
CVS		= cvs -q
SVN		= svn
CP		= cp
DICE_SRCDIR	?= $(L4DIR)/../dice
DICE_OBJDIR	?= $(DICE_SRCDIR)
DICE		= $(firstword $(wildcard $(DICE_OBJDIR)/src/dice \
				$(DROPS_STDDIR)/tool/bin/dice \
				 $(shell which dice 2>/dev/null) ) \
				 did_not_find_dice___please_install_dice )
DICE_CPP_NAME	= cpp0

DICE_INCDIR	?= $(DICE_SRCDIR)/include

ECHO		= echo

GENOFFSETS	= $(L4DIR)/tool/bin/genoffsets.pl
GOSH		= $(firstword $(wildcard $(L4DIR)/../tools/gosh/gosh \
				$(DROPS_STDDIR)/tool/bin/gosh \
				 $(shell which gosh 2>/dev/null) ) \
				 did_not_find_gosh___please_install_gosh )
HOST_CC		= gcc
HOST_CXX	= g++
INDENT		= indent -sob
INSTALL		= install
# the following two variables should be overwritten in Makeconf.bid.local
LD		= $(SYSTEM_TARGET)ld
LATEX		= latex
PDFLATEX	= pdflatex
GREP		= grep
LN		= ln
MKDIR		= mkdir -p
MKFLAGS		+=$(MKFLAGS_$@)
NM		= $(SYSTEM_TARGET)nm
OBJCOPY		= $(SYSTEM_TARGET)objcopy
PWDCMD		= sh -c pwd
RANLIB		= $(SYSTEM_TARGET)ranlib
RM		= rm -f
SCRUB		= $(RM) $(wildcard *.old) $(wildcard *~) $(wildcard *.bak) \
                        $(wildcard \#*\#)
SED		= sed
SHELL		= /bin/bash
SIZE		= $(SYSTEM_TARGET)size
STRIP		= $(SYSTEM_TARGET)strip
TR		= tr
GEN_DOPECODE	= $(L4DIR)/tool/gen_dopecode/gen_dopecode
ABS2REL		= $(L4DIR)/tool/bin/abs2rel.sh
# it's optional to be able to set it as environment variable
FIASCOUX	?= $(L4DIR)/../kernel/fiasco/build-ux/fiasco
DISASM_CMD      ?= $(SYSTEM_TARGET)objdump -ld $(1) | less

# functions that are handy
absfilename_target_dir_needs_to_exist = $(foreach w,$(1),$(addsuffix /$(notdir $(w)),$(shell cd $(dir $(w)) 2>/dev/null&&$(PWDCMD))))
absfilename     = $(shell $(L4DIR)/mk/rel2abs.sh $(1))
findfile	= $(firstword $(wildcard $(addsuffix /$(1),$(2))) $(1)_NOT_FOUND)

# include this one early to be able to set OBJ_BASE
-include $(L4DIR)/Makeconf.local

#ifeq ($(filter $(IGNORE_OBJDIR_TARGETS),$(MAKECMDGOALS)),)
# output directory
#ifeq ($(O)$(OBJ_BASE),)
#$(error need to give builddir with O=.../builddir)
#else
#ifneq ($(O),)
#ifeq ($(origin OBJ_BASE),undefined)
#OBJ_BASE := $(call absfilename, $(O))
#export OBJ_BASE
#endif
#endif
#endif
#endif

ifeq ($(origin L4DIR_ABS),undefined)
L4DIR_ABS      := $(call absfilename,$(L4DIR))
endif
ifeq ($(origin PKGDIR_ABS),undefined)
PKGDIR_ABS     := $(call absfilename,$(PKGDIR))
endif
ifeq ($(origin SRC_DIR),undefined)
SRC_DIR        := $(shell pwd)
endif
ifeq ($(origin SRC_BASE_ABS),undefined)
SRC_BASE     ?= $(L4DIR)
SRC_BASE_ABS := $(call absfilename,$(SRC_BASE))
export SRC_BASE_ABS
endif
ifeq ($(origin OBJ_DIR),undefined)
OBJ_DIR        := $(subst $(SRC_BASE_ABS),$(OBJ_BASE),$(SRC_DIR))
endif
ifeq ($(origin PKGDIR_OBJ),undefined)
PKGDIR_OBJ     := $(call absfilename,$(OBJ_DIR)/$(PKGDIR))
endif

# if PKGDIR is not in L4DIR, we have an external package, so make up some
# build-dir for it
ifneq ($(patsubst $(L4DIR_ABS)/%,,$(PKGDIR_ABS)),)
ifneq ($(filter-out $(OBJ_BASE)/ext-pkg%,$(PKGDIR_OBJ)),)
PKGDIR_OBJ     := $(OBJ_BASE)/ext-pkg$(PKGDIR_OBJ)
OBJ_DIR        := $(OBJ_BASE)/ext-pkg$(OBJ_DIR)
endif
endif

# sanity check the object dir
ifneq ($(SRC_BASE_ABS),$(OBJ_BASE))
ifeq ($(SRC_DIR),$(OBJ_DIR))
$(warning Sorry, your object or source path became garbled.)
$(warning OBJ_BASE: $(OBJ_BASE))
$(warning SRC_BASE_ABS: $(SRC_BASE_ABS))
$(warning SRC_DIR: $(SRC_DIR))
$(warning OBJ_DIR: $(OBJ_DIR))
$(warning PKGDIR: $(PKGDIR))
$(warning L4DIR_ABS: $(L4DIR_ABS))
$(warning PKGDIR_ABS: $(PKGDIR_ABS))
$(warning PKGDIR_OBJ: $(PKGDIR_OBJ))
$(error Please investigate.)
endif
endif


OBJ_DIR_EXPORT = $(OBJ_DIR)
export OBJ_DIR_EXPORT

VPATH_SRC_BASE ?= $(SRC_DIR)

# Makeconf.local handling
# dont use -include here, as we have special build conditions in $(L4DIR)/
#ifeq ($(origin BID_ROOT_CONF),undefined)
#BID_ROOT_CONF := $(call absfilename, $(OBJ_BASE))/Makeconf.bid.local
#endif
#ifeq ($(filter $(IGNORE_OBJDIR_TARGETS),$(MAKECMDGOALS)),)
#ifeq ($(wildcard $(BID_ROOT_CONF)),)
#ifeq ($(BID_IGN_ROOT_CONF),)
#$(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)
#endif
#else
#include $(BID_ROOT_CONF)
#endif
#endif

#-include $(L4DIR)/Makeconf.$(CONFIG_LABEL)

#-include $(OBJ_BASE)/Makeconf.local
#ifneq ($(PKGDIR),)
#-include $(PKGDIR)/Makeconf.local
#endif
# if it is not already set, we use this in the local dir
MAKECONFLOCAL ?= Makeconf.local
-include $(MAKECONFLOCAL)

DROPS_STDDIR	?= $(PKGDIR)/build
ifeq ($(STATICFILE),)
STATICFILE	= $(OBJ_BASE)/pkg/STATIC $(L4DIR)/pkg/STATIC
endif

# a nasty workaround for make-3.79/make-3.80. The former needs an additional
# $$ for $-quotation when calling a function.
BID_IDENT	= $(1)
ifeq ($(call BID_IDENT,$$),)
BID_DOLLARQUOTE	= $$
endif
BID_COMMA	= ,

ifneq ($(PL),)
PL_j := -j $(PL)
export PL
endif

#include $(L4DIR)/mk/config.inc

ifeq ($(HAVE_LDSO),y)
# MAKEDEP-call:
# arg1 - compiler binary name
# arg2 - [opt] compiler target. Will be written as target within the
# 	       dependency file
# arg3 - [opt] name of the dependency file. If unset, .<arg2>.d will be used.
# arg4 - [opt] alternative binary name
ifeq ($(origin BID_LIBGENDEP), undefined)
BID_LIBGENDEP := $(firstword $(wildcard $(call absfilename, \
				$(OBJ_BASE)/tool/gendep/libgendep.so \
				$(DROPS_STDDIR)/tool/lib/libgendep.so )))
endif

ifeq ($(HOST_SYSTEM),linux)
	LD_PRELOAD = LD_PRELOAD
endif
ifeq ($(HOST_SYSTEM),darwin)
	LD_PRELOAD = DYLD_FORCE_FLAT_NAMESPACE=1 DYLD_INSERT_LIBRARIES
endif
MAKEDEP=$(LD_PRELOAD)=$(BID_LIBGENDEP) GENDEP_TARGET=$(if $(2),$(2),$@) \
		    GENDEP_BINARY=$(1) $(if $(3),GENDEP_DEPFILE=$(3)) \
		    $(if $(4),GENDEP_BINARY_ALT1=$(4))
endif

# macros used here and in packages
checkcc   = $(shell if $(CC) $(1) -o /dev/null -c -x c \
                    /dev/null > /dev/null 2>&1; then echo "$(1)"; fi)
checkcxx  = $(shell if $(CXX) $(1) -o /dev/null -c -x c++ \
                    /dev/null > /dev/null 2>&1; then echo "$(1)"; fi)

# the gcc specific variables: version, base dir, include dir, gcc lib
# note: determining these variables is slow, and the values should
#       be set in Makeconf.bid.local. However, this is the place were
#       they are determined on a 'make config' in $(L4DIR)
GCCVERSION_f	= $(shell $(CC) -dumpversion | sed -e 's/\(.*\)\..*/\1/')
GCCMAJORVERSION_f=$(shell $(CC) -dumpversion | sed -e 's/\([^.]*\).*/\1/')
GCCMINORVERSION_f=$(shell $(CC) -dumpversion | sed -e 's/[^.]*\.\([^.]*\).*/\1/')
GCCSUBVERSION_f	= $(shell $(CC) -dumpversion | sed -e 's/.*\.\(.*\)/\1/')
GCCDIR_f	= $(shell LC_ALL=C $(CC) -print-search-dirs|sed -ne 's+^install: \(.*[^/][^/]*\)/+\1+p' )
GCCLIB_f	= $(shell $(CC) -print-libgcc-file-name)
GCCLIB_EH_f	= $(filter /%,$(shell $(CC) -print-file-name=libgcc_eh.a))
GCCINCDIR_f	= $(addprefix $(call GCCDIR_f),/include /include-fixed)
GCCNOSTACKPROTOPT_f= $(call checkcc,-fno-stack-protector)

GCCINCDIR	= $(GCCDIR)/include $(GCCDIR)/include-fixed
I_GCCINCDIR	= $(addprefix -I,$(GCCINCDIR))

ifneq ($(PKGDIR),)
  ifeq ($(origin PKGNAME),undefined)
    PKGNAME := $(notdir $(shell cd $(PKGDIR);pwd))
  endif
endif

ifeq ($(V),1)
  VERBOSE =
endif
ifeq ($(V),0)
  VERBOSE = @
endif

# indicate if we are using dietlibc or uClibc
ifeq ($(USE_DIETLIBC),y)
# dietlibc explicitly set for all architectures
  DEFINES	+= -DUSE_DIETLIBC=y
  USE_DIETLIBC	= y
  LIBC_TYPE	= diet
  $(warning The use of dietlibc is deprecated, please switch to uclibc.)
  $(warning Dietlibc will soon be removed from the tree.)
else
  # uClibc explicitly set for all architectures
  DEFINES	+= #-DUSE_UCLIBC=y
  USE_UCLIBC	= #y
  LIBC_TYPE	= uc
endif

ifeq ($(RELEASE_MODE),y)
DEFINES		+= -DL4BID_RELEASE_MODE
endif

ifeq ($(USE_TASKLIB),y)
DEFINES		+= -DUSE_TASKLIB=y
endif

ifeq ($(ARCH),arm)
ifeq ($(RAM_BASE),)
$(error RAM_BASE not given, needed for ARM architecture builds.)
endif
else #arch != arm
  RAM_BASE	= 0x0
endif

DEFINES         += -DRAM_BASE=$(RAM_BASE)


ifneq ($(filter linux l4linux host,$(MODE)),)
HOST_LINK      := 1
endif

#
# SUBDIR handling, not within the OBJ-*/ dirs
#
ifeq ($(SYSTEM),)
ifneq ($(SUBDIRS),)
.PHONY: $(SUBDIRS)
$(SUBDIRS):
	$(VERBOSE)PWD=$(PWD)/$@ $(MAKE) -C $@ all

# we know that SUBDIRS isn't empty, hence we can avoid the dir-test
scrub clean cleanall::
	$(VERBOSE)set -e; $(foreach i,$(SUBDIRS), \
		PWD=$(PWD)/$(i) $(MAKE) -C $(i) $@ $(MKFLAGS) $(MKFLAGS_$(i));)

install:: $(SUBDIRS)
	$(VERBOSE)set -e; $(foreach i,$(SUBDIRS), \
		PWD=$(PWD)/$(i) $(MAKE) -C $(i) $@ $(MKFLAGS) $(MKFLAGS_$(i));)

endif

all:: $(OBJ_DIR)/Makefile

$(OBJ_DIR)/Makefile: $(L4DIR)/mk/Makeconf
	$(VERBOSE)install -d $(dir $@)
	$(VERBOSE)echo '# automatically created -- modifications will be lost' > $@
	$(VERBOSE)echo 'SRC := $(SRC_DIR)'                                    >> $@
	$(VERBOSE)echo 'OBJ := $(OBJ_BASE)'                                   >> $@
	$(VERBOSE)echo '.PHONY: x $$(MAKECMDGOALS)'                           >> $@
	$(VERBOSE)echo 'x:'                                                   >> $@
	$(VERBOSE)echo '	PWD=$$(SRC) $$(MAKE) -C $$(SRC) O=$$(OBJ)'    >> $@
	$(VERBOSE)echo '$$(MAKECMDGOALS):'                                    >> $@
	$(VERBOSE)echo '	PWD=$$(SRC) $$(MAKE) -C $$(SRC) O=$$(OBJ) $$@'>> $@

else
# we are within an OBJ-*/ dir, create dummy target
$(SUBDIRS):
endif

#
# Dependency section
#
#

# the general dependencies: All generated files depend on ".general.d".
# ".general.d" itself depends on the mk-Makeconf, the optional
# Makeconf.local, the Makeconf.bid.local, the packet-Makeconf.local and the
# Makeconf.local. This ensures a rebuilt if any of the configuration-
# or make-files changes.
#
# We have this nasty if-readable-magic to allow the files to disappear
# or to appear. Depending on if the according makeconf exists now, the
# if-readable magic .general.d is used on existance or non-existence.

BID_DEPEND_GENERAL_D_COND = \
	if [ -r $(1) ] ; then echo -e '$@: $(1)\n$(1):\n' >>$@ ; \
	  else echo '$$(if $$(wildcard $(1)), $@: FORCE)' >>$@; fi

ifeq ($(SYSTEM),)
GENERAL_D_LOC := $(OBJ_DIR)/.general.d
else
GENERAL_D_LOC := .general.d
endif

$(GENERAL_D_LOC): $(L4DIR)/mk/Makeconf
	@$(BUILD_MESSAGE)
	@install -d $(dir $@)
	$(DEPEND_VERBOSE)echo '$@: $(SRC_DIR)/Makefile ' > $@
	$(DEPEND_VERBOSE)$(call BID_DEPEND_GENERAL_D_COND,\
		$(OBJ_BASE)/Makeconf.bid.local)
	$(DEPEND_VERBOSE)$(call BID_DEPEND_GENERAL_D_COND,\
		$(OBJ_BASE)/Makeconf.local)
	$(DEPEND_VERBOSE)$(call BID_DEPEND_GENERAL_D_COND,\
		$(L4DIR)/Makeconf.local)
	$(DEPEND_VERBOSE)$(call BID_DEPEND_GENERAL_D_COND,\
		$(L4DIR)/Makeconf.$(CONFIG_LABEL))
	$(if $(PKGDIR),$(DEPEND_VERBOSE)$(call BID_DEPEND_GENERAL_D_COND,\
		$(PKGDIR)/Makeconf.local))
	$(DEPEND_VERBOSE)$(call BID_DEPEND_GENERAL_D_COND,\
		$(MAKECONFLOCAL))

DEPS	+= $(GENERAL_D_LOC)

ifneq ($(DEPENDS_PKGS),)
DEPENDS_PKGS_MISSING := $(strip $(foreach i,$(DEPENDS_PKGS),		\
	                          $(if $(wildcard $(L4DIR)/pkg/$(i)),,$(i))))

ifneq ($(DEPENDS_PKGS_MISSING),)
# clear TARGET to prevent building anything
TARGET =
all::
	@echo -e "\033[32mPackage dependencies missing: \033[1m$(DEPENDS_PKGS_MISSING)\033[22m, skipping.\033[0m"
endif
endif

#
# Messages
#

# set SHOWMESSAGES=true or 'y' to print textual action descriptions
SHOWMESSAGES ?= true

# coloring on color-capable terminals
# enabled by setting BID_COLORED_PHASES to y
ifeq ($(BID_COLORED_PHASES),y)
ifeq ($(COLOR_TERMINAL),y)
  EMPHSTART = '\033[34m'
  EMPHSTOP  = '\033[0m'
else
  EMPHSTART =
  EMPHSTOP  =
endif
endif


ifneq (,$(filter y true, $(SHOWMESSAGES)))
AR_MESSAGE?=	echo -e "  ==> Archiving into $@"
BUILD_MESSAGE?=	echo -e "  ... Building $@"
BUILT_MESSAGE?= echo -e $(EMPHSTART)'  ==> "$@" built'$(EMPHSTOP)
COMP_MESSAGE?=	echo -e "  ... Compiling $@"
COMP_P_MESSAGE?=echo -e "  ... Compiling PIC $@"
COMP_PR_MESSAGE?=echo -e "  ... Compiling PROFILE $@"
GEN_MESSAGE?=	echo -e "  ... Generating $@"
LINK_MESSAGE?=	echo -e "  ==> Linking $@"
LINK_SHARED_MESSAGE?=	echo -e "  ==> Linking to shared $@"
LINK_PARTIAL_MESSAGE?= echo -e "  ==> Partial linking to $@"
DEP_MESSAGE?=	echo -e "  ... Building dependencies for $<"
CLEAN_MESSAGE?=	echo -e "  ... Removing created files"
CLEANALL_MESSAGE?=echo -e "  ... Removing all created files"
INSTALL_LINK_MESSAGE?=echo -e "  ==> Updating symlinks"
INSTALL_DOC_MESSAGE?=echo -e "  ==> Installing $(<) documentation"
INSTALL_DOC_LOCAL_MESSAGE?= echo -e "  ==> Installing $(<) documentation locally"
INSTALL_MESSAGE?=echo -e "  ==> Installing $^"
INSTALL_LOCAL_MESSAGE?=echo -e "  ==> Installing $(<) to local build-tree"
UPDATE_HTML_MESSAGE?=echo -e "  ! You should remake your doc directory in $(1)"
endif


# allows an include $(DEPSVAR) at the end of the makefile
# but prevents rebuilding them on a scrub, clean, cleanall and help
ifneq ($(filter scrub clean cleanall help,$(MAKECMDGOALS)),)
DEPSVAR	=
else
DEPSVAR	= $(DEPS)
endif

#
# Some rules
#

# addfileheader-rule: allows "make addfileheader main.c server.c"-like
# commands and automatically inserts the path within the package
# options may be passed with $(ADDFILEHEADER_OPTIONS)
ADDFILEHEADER_PREFIX = $(patsubst $(call absfilename,$(PKGDIR)/)%,\
				  $(PKGNAME)/%,$(call absfilename,./))
ADDFILEHEADER_FILES = $(filter-out addfileheader,$(MAKECMDGOALS))
addfileheader:
	addfileheader $(ADDFILEHEADER_OPTIONS) -p $(ADDFILEHEADER_PREFIX) $(ADDFILEHEADER_FILES)
        

.PHONY: FORCE

endif	# _L4DIR_MK_MAKECONF undefined