summaryrefslogtreecommitdiff
path: root/.meta/generiere-mks.mk
blob: b2cb7faefa411b7ed85b9e362d6d6e88d7c1c9ef (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
../.meta/prefix.mk: ../.meta/prefix-Liste ../.meta/generiere-mks.mk
	{ \
	  cat "$<"; \
	  for ton in c d e f g a h; do \
			for halbton in "" is es; do \
				for oktave in "" _; do \
					printf '%s%s%s\n' "$${ton}" "$${halbton}" "$${oktave}"; \
				done; \
			done; \
	  done \
	  | sed " \
			s/^ees/es/; \
			s/^hes/b/; \
			s/^/transponiert-/; \
	  "; \
	  seq 20 \
	  | sed 'p;h;s/$$/E/;g;s/$$/S/'; \
	} \
	| while read -r prefix; do \
		printf '%%-%s.pre: ' "$${prefix}"; \
		printf '%%.pre\n' "$${prefix}"; \
		printf '\tsed " \\\n'; \
		if [ -z "$${prefix##transponiert-*}" ]; then \
			printf '\t\t1i define(\\`transponiert'"'"',%s) \\\n' "$${prefix#transponiert-}"; \
		elif echo "$${prefix}" | grep -qx "[0-9]\+[ES]\?"; then \
			printf '\t\t1i define(\\`STR_%s'"'"') \\\n' "$${prefix}"; \
		else \
			printf '\t\t1i define(\\`%s'"'"') \\\n' "$${prefix}"; \
		fi; \
		printf '\t" "$$<" >"$$@"\n'; \
		printf '\n'; \
	done \
	>"$@"

../.meta/papierformat.mk: ../.meta/generiere-mks.mk ../.meta/*.papierformat
	for datei in ../.meta/*.papierformat; do \
		name="$${datei##*/}"; \
		name="$${name%.*}"; \
		printf "%%-%s.pre: %s %%.pre\n" "$${name}" "$${datei}"; \
		printf "\tcat \$$^ > \$$@\n"; \
	done \
	>"$@"

meta.mk: ../.meta/papierformat.mk ../.meta/prefix.mk

.PHONY: meta.mk