Debian Codegraph @

texk/gregorio/gregorio-src/src/Makefile.am

raw
1 # Copyright (C) 2006-2025 The Gregorio Project (see CONTRIBUTORS.md)
2 #
3 # This file is part of Gregorio.
4 #
5 # Gregorio is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # Gregorio is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with Gregorio. If not, see <http://www.gnu.org/licenses/>.
17
18 AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/src/gabc -I$(top_srcdir)/src/dump -I$(top_srcdir)/src/gregoriotex
19 AM_CFLAGS = $(KPSE_CFLAGS)
20 LDADD = $(KPSE_LIBS)
21
22 bin_PROGRAMS = gregorio$(GREGORIO_EXE_SUFFIX)
23 gregorio__GREGORIO_EXE_SUFFIX__SOURCES = \
24 gregorio-utils.c characters.c characters.h messages.c messages.h struct.c \
25 struct.h struct_iter.h enum_generator.h unicode.c unicode.h sha1.c sha1.h \
26 support.c support.h config.h bool.h plugins.h utf8strings.h dump/dump.c \
27 gregoriotex/gregoriotex-write.c gregoriotex/gregoriotex-position.c \
28 gregoriotex/gregoriotex.h
29
30 @MK@ifneq ($(wildcard ../.git),)
31 @MK@ _tag_ = $(shell git describe --exact-match HEAD 2>/dev/null)
32 @MK@ ifeq ($(_tag_),)
33 @MK@ DEFS += -DBRANCH_VERSION='"$(shell git rev-parse --abbrev-ref HEAD)-$(shell git rev-parse --short HEAD)-$(shell git rev-list HEAD --count)"'
34 @MK@ endif
35 @MK@else
36 @MK@ ifneq ($(wildcard ../.hg/git),)
37 @MK@ _gitnode_ = $(shell hg log --template='{gitnode}' -r .)
38 @MK@ ifeq ($(_gitnode_),)
39 @MK@ DEFS += -DBRANCH_VERSION='"$(shell hg log --template='{activebookmark}-hg:{manifest}' -r .)"'
40 @MK@ else
41 @MK@ _tag_ = $(shell git --git-dir=../.hg/git describe --exact-match '$(_gitnode_)' 2>/dev/null)
42 @MK@ ifeq ($(_tag_),)
43 @MK@ DEFS += -DBRANCH_VERSION='"$(shell hg log --template='{activebookmark}' -r .)-$(shell git --git-dir=../.hg/git rev-parse --short '$(_gitnode_)')-$(shell git --git-dir=../.hg/git rev-list '$(_gitnode_)' --count)"'
44 @MK@ endif
45 @MK@ endif
46 @MK@ endif
47 @MK@endif
48
49 # gabc files
50 gregorio__GREGORIO_EXE_SUFFIX__SOURCES += \
51 gabc/gabc-elements-determination.c gabc/gabc-write.c \
52 gabc/gabc-glyphs-determination.c gabc/gabc.h \
53 gabc/gabc-score-determination.h gabc/gabc-score-determination.c \
54 gabc/gabc-score-determination-y.h gabc/gabc-score-determination-y.c \
55 gabc/gabc-score-determination-l.h gabc/gabc-score-determination-l.c \
56 gabc/gabc-notes-determination-l.c vowel/vowel.h vowel/vowel.c \
57 vowel/vowel-rules.h vowel/vowel-rules-l.h vowel/vowel-rules-l.c \
58 vowel/vowel-rules-y.h vowel/vowel-rules-y.c
59
60 EXTRA_DIST = encode_utf8strings.c utf8strings.h.in utf8strings.h \
61 gabc/gabc-notes-determination.l gabc/gabc-notes-determination-l.c \
62 gabc/gabc-score-determination.h gabc/gabc-score-determination.y \
63 gabc/gabc-score-determination-y.h \
64 gabc/gabc-score-determination-y.c gabc/gabc-score-determination.l \
65 gabc/gabc-score-determination-l.h \
66 gabc/gabc-score-determination-l.c vowel/vowel-rules.l \
67 vowel/vowel-rules-l.h vowel/vowel-rules-l.c vowel/vowel-rules.y \
68 vowel/vowel-rules-y.h vowel/vowel-rules-y.c
69
70 if HAVE_RC
71 # Windows resources (see windows/README.md)
72 gregorio-resources.o: ../windows/gregorio-resources.rc ../windows/gregorio.ico
73 $(RC) $(RCFLAGS) $< -o $@
74
75 gregorio__GREGORIO_EXE_SUFFIX__SOURCES += ../windows/gregorio-resources.rc ../windows/gregorio.ico
76 LDADD += gregorio-resources.o
77 endif
78
79 gabc/gabc-score-determination-y.c: gabc/gabc-score-determination.y
80 $(YACC) -Wno-yacc -v -d -p "gabc_score_determination_" -o $@ $<
81 gabc/gabc-score-determination-y.h: gabc/gabc-score-determination-y.c
82 ## Recover from the removal of gabc/gabc-score-determination-y.h, see
83 ## https://www.gnu.org/software/automake/manual/html_node/Multiple-Outputs.html
84 @if test -f $@; then :; else \
85 rm -f gabc/gabc-score-determination-y.c; \
86 $(MAKE) $(AM_MAKEFLAGS) gabc/gabc-score-determination-y.c; \
87 fi
88
89 gabc/gabc-score-determination-l.c: gabc/gabc-score-determination.l
90 $(LEX) -o $@ --header-file=gabc/gabc-score-determination-l.h $<
91 gabc/gabc-score-determination-l.h: gabc/gabc-score-determination-l.c
92 ## Recover from the removal of gabc/gabc-score-determination-l.h, see
93 ## https://www.gnu.org/software/automake/manual/html_node/Multiple-Outputs.html
94 @if test -f $@; then :; else \
95 rm -f gabc/gabc-score-determination-l.c; \
96 $(MAKE) $(AM_MAKEFLAGS) gabc/gabc-score-determination-l.c; \
97 fi
98
99 gabc/gabc-notes-determination-l.c: gabc/gabc-notes-determination.l
100 $(LEX) -o $@ $<
101
102 vowel/vowel-rules-y.c: vowel/vowel-rules.y
103 $(YACC) -v -d -o $@ $<
104 vowel/vowel-rules-y.h: vowel/vowel-rules-y.c
105 ## Recover from the removal of vowel/vowel-rules-y.h, see
106 ## https://www.gnu.org/software/automake/manual/html_node/Multiple-Outputs.html
107 @if test -f $@; then :; else \
108 rm -f vowel/vowel-rules-y.c; \
109 $(MAKE) $(AM_MAKEFLAGS) vowel/vowel-rules-y.c; \
110 fi
111
112 vowel/vowel-rules-l.c: vowel/vowel-rules.l
113 $(LEX) -o $@ --header-file=vowel/vowel-rules-l.h $<
114 vowel/vowel-rules-l.h: vowel/vowel-rules-l.c
115 ## Recover from the removal of vowel/vowel-rules-l.h, see
116 ## https://www.gnu.org/software/automake/manual/html_node/Multiple-Outputs.html
117 @if test -f $@; then :; else \
118 rm -f vowel/vowel-rules-l.c; \
119 $(MAKE) $(AM_MAKEFLAGS) vowel/vowel-rules-l.c; \
120 fi
121
122 utf8strings.h: utf8strings.h.in
123 $(MAKE) $(AM_MAKEFLAGS) encode_utf8strings${EXEEXT}
124 ./encode_utf8strings${EXEEXT} $< $@
125
126 encode_utf8strings${EXEEXT}: encode_utf8strings.c
127 $(CC) -o $@ $<
128
129 clean-local:
130 find . -name '*.gcno' -print | xargs rm -f --
131 find . -name '*.gcda' -print | xargs rm -f --
132
133 BUILT_SOURCES = utf8strings.h gabc/gabc-notes-determination-l.c \
134 gabc/gabc-score-determination-l.c \
135 gabc/gabc-score-determination-l.h \
136 gabc/gabc-score-determination-y.c \
137 gabc/gabc-score-determination-y.h vowel/vowel-rules-l.c \
138 vowel/vowel-rules-l.h vowel/vowel-rules-y.c \
139 vowel/vowel-rules-y.h
140
141 CLEANFILES = encode_utf8strings${EXEEXT}
142 MAINTAINERCLEANFILES = $(BUILT_SOURCES)