Makefile.buildingblocks 1.53 KB
Newer Older
thomas.forbriger's avatar
thomas.forbriger committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# this is <Makefile.buildingblocks>
# ----------------------------------------------------------------------------
# $Id: $
# 
# Copyright (c) 2010 by Thomas Forbriger (BFO Schiltach) 
# 
# some building blocks for Makefiles
#
# The code in this file should be used by copy and paste operations to be
# added to individual Makefiles. Include operations are not appropriate, since
# this complicates reading dependencies across directories.
# 
# REVISIONS and CHANGES 
#    16/08/2010   V1.0   Thomas Forbriger
# 
# ============================================================================
#
18
19
20
# This is the sequence of standard targets
# ----------------------------------------
# created by the template generator "new"
thomas.forbriger's avatar
thomas.forbriger committed
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

all:

flist: Makefile
	echo $^ | tr ' ' '\n' | sort > $@

.PHONY: edit
edit: flist; vim $<

.PHONY: clean
clean: ; 
	-find . -name \*.bak | xargs --no-run-if-empty /bin/rm -v
	-/bin/rm -vf flist

# ============================================================================
36
37
# a variable definition to check variable settings
# ------------------------------------------------
thomas.forbriger's avatar
thomas.forbriger committed
38

39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# if you want to check whether variable TF_PUBLICATIONPATH is non-empty,
# insert line
#
## $(call CHECKVAR,TF_PUBLICATIONPATH)
#
# in your Makefile
#
# if you want to check whether variable AVAR, BVAR, and CVAR are non-empty,
# insert line
#
## $(call CHECKVARS,AVAR BVAR CVAR)
#
# in your Makefile

CHECKVAR=$(if $($(1)),,$(error ERROR: missing variable $(1)))
CHECKVARS=$(foreach var,$(1),$(call CHECKVAR,$(var)))
thomas.forbriger's avatar
thomas.forbriger committed
55
56

# ----- END OF Makefile.buildingblocks -----