File: substitute.make

package info (click to toggle)
lilypond 2.24.4-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 70,352 kB
  • sloc: cpp: 87,962; lisp: 43,344; xml: 31,269; python: 22,974; sh: 4,090; yacc: 4,080; perl: 2,873; lex: 1,387; makefile: 76
file content (54 lines) | stat: -rw-r--r-- 1,165 bytes parent folder | download | duplicates (4)
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
# make/Substitute.make

sed-endline = sed 's!$$!\\!'
sed-newline = sed 's!$$!\n!'
sed-quotes = sed "s!\'!\\\&!g"
sed-quote-line = sed 's!.*$$!\"&\"!'

date := $(shell date '+%d%b%y'|tr '[a-z]' '[A-Z]' )
DATE = $(date)

# for all FILE in AT_FILES:
# substitute occurrences of @FILE@ with contents $(at-dir)BLA$(at-ext)
sed-atfiles = -e '\#' $(foreach i, $(AT_FILES), \
  -e '/@$i@/r $(at-dir)/$i$(at-ext)' -e 's%@$i@%%g')

# for all VAR in ATVARIABLES
# substitute occurrences of @VAR@ with $(VAR)
sed-atvariables = -e '\#' $(foreach i, $(ATVARIABLES), -e 's!@$i@!$($i)!g')

# config_make dep isn't working. Why?
$(outdir)/%: %.in $(config_make) $(depth)/VERSION
	$(call ly_progress,Making,$@,< in)
	rm -f $@
	sed $(sed-atfiles) $(sed-atvariables) < $< > $@

ATVARIABLES = \
  BUILD_VERSION\
  DATE\
  FONTFORGE\
  GUILE\
  MAJOR_VERSION\
  MINOR_VERSION\
  NCSB_DIR\
  PATCH_LEVEL\
  PATHSEP\
  PERL\
  PYTHON\
  SHELL\
  TARGET_PYTHON \
  TOPLEVEL_VERSION\
  bindir\
  datadir\
  date\
  lilypond_datadir\
  lilypond_docdir\
  local_lilypond_datadir\
  localedir\
  outdir\
  prefix\
  program_prefix\
  program_suffix\
  sharedstatedir\
  src-dir\
  top-src-dir\