]> git.donarmstrong.com Git - lilypond.git/blob - stepmake/stepmake/generic-targets.make
Merge remote branch 'origin' into release/unstable
[lilypond.git] / stepmake / stepmake / generic-targets.make
1 .PHONY : all clean bin-clean config default dist exe help html lib TAGS\
2          po doc doc-stage-1 WWW-1 WWW-2 WWW-post local-WWW-1 local-WWW-2
3
4 all:     default
5         $(LOOP)
6
7 bin:
8         $(MAKE) PACKAGE=$(PACKAGE) package=$(package) -C lily
9
10 man:
11         $(LOOP)
12
13 clean: local-clean
14         -rm -rf $(outdir)
15         $(LOOP)
16
17 ifeq (,$(findstring metafont,$(STEPMAKE_TEMPLATES)))
18 bin-clean: local-bin-clean
19         -rm -rf $(outdir)
20         $(LOOP)
21 else
22 bin-clean:
23 endif
24
25 local-bin-clean: local-clean
26
27 ifneq ($(strip $(depth)),.)
28 dist:
29         $(MAKE) -C $(depth) dist
30 endif
31
32 distclean: clean
33         $(MAKE) local-distclean
34
35 cvs-clean:
36         $(MAKE) local-distclean
37         rm -rf out
38         rm -rf out-www
39         rm -f aclocal.m4 configure
40
41 maintainerclean:
42         $(LOOP)
43         $(MAKE) local-maintainerclean
44         $(MAKE) local-distclean
45
46
47 # This doesn't allow command-line options, is it really useful? -jm
48 config:
49         ./$(src-depth)/configure
50
51
52 generic-help:
53         @echo "Makefile for $(PACKAGE_NAME) $(TOPLEVEL_VERSION)"
54         @echo "Usage: make ["VARIABLE=value"]... [TARGET]"
55         @echo
56         @echo "Targets specific to current directory:"
57
58 help: generic-help local-help
59         @echo "Generic targets that recurse into subdirectories*:"
60         @echo "  all          update everything except documentation with images"
61         @echo "  clean        remove all generated stuff in $(outdir)"
62         @echo "  bin-clean    same as clean, except that mf/out is preserved"
63         @echo "  doc          update documentation with images in directory \`out-www'"
64         @echo "  doc-stage-1  update only PDF and Info documentation in directory \`out-www'"
65         @echo "  doc-clean    clean \`out-www' directory"
66         @echo "  install      install programs and data (prefix=$(prefix))"
67         @echo "  uninstall    uninstall programs and data"
68         @echo
69         @echo "  *Note: Prepend \`local-' (eg. \`local-clean') to restrict"
70         @echo "         any of the above commands to the current directory."
71         @echo
72         @echo "Other generic targets:"
73         @echo "  default      same as the empty target"
74         @echo "  bin          check the lily directory and rebuild lilypond.exe if needed"
75         @echo "  exe          update all executables"
76         @echo "  help         this help"
77         @echo "  lib          update all libraries"
78         @echo "  TAGS         generate tagfiles"
79         @echo
80         @echo "\`make' may be invoked from any subdirectory."
81
82 local-help:
83
84 local-dist: $(DIST_FILES) $(OUT_DIST_FILES) $(NON_ESSENTIAL_DIST_FILES)
85         mkdir -p $(distdir)/$(localdir)
86         $(LN) $(DIST_FILES:%=$(src-dir)/%) $(distdir)/$(localdir)
87
88         case "$(NON_ESSENTIAL_DIST_FILES)x" in x) ;; *) \
89                 $(LN) $(NON_ESSENTIAL_DIST_FILES:%=$(src-dir)/%) $(distdir)/$(localdir);; \
90         esac
91         case "$(OUT_DIST_FILES)x" in x) ;; *) \
92                 mkdir -p $(distdir)/$(localdir)/$(outdir); \
93                 $(LN) $(OUT_DIST_FILES) $(distdir)/$(localdir)/$(outdir);; \
94         esac
95         $(foreach i, $(SUBDIRS), $(MAKE) top-src-dir=$(top-src-dir) distdir=$(distdir) localdir=$(localdir)/$(notdir $(i)) -C $(i) local-dist &&) true
96
97
98
99 html: $(HTML_FILES)
100
101 TAGS:
102         $(LOOP)
103         $(MAKE) local-tags
104
105 DEEPER_TAGS_FILES = $(shell find $(pwd) -mindepth 2 -name 'TAGS')
106 local-tags:
107         -if [ -n "$(TAGS_HEADERS)$(TAGS_SOURCES)$(DEEPER_TAGS_FILES)" ]; then \
108                 etags $(ETAGS_FLAGS) $(DEEPER_TAGS_FILES:%=--include=%) \
109                         $(TAGS_SOURCES) $(TAGS_HEADERS) $(ERROR_LOG) ; \
110                 ctags $(CTAGS_FLAGS) $(TAGS_SOURCES) $(TAGS_HEADERS) \
111                         $(ERROR_LOG) ; \
112         fi
113
114 $(outdir)/version.hh: $(depth)/VERSION $(config_make) $(step-bindir)/make-version.py
115         $(PYTHON) $(step-bindir)/make-version.py $< > $@
116
117 $(outdir)/config.hh: $(config_h)
118         cp -p $< $@
119
120 configure: configure.in aclocal.m4
121         NOCONFIGURE=yes $(src-depth)/autogen.sh
122         chmod +x configure
123
124 local-clean:
125
126 local-distclean:
127
128 local-maintainerclean:
129
130 install-strip:
131         $(MAKE) INSTALLPY="$(INSTALLPY) -s" install
132
133 ifeq ($(strip $(depth)),.)
134 final-install:
135 else
136 final-install:
137         $(LOOP)
138
139 install: local-install
140         $(LOOP)
141 endif
142
143 local-install:
144
145 uninstall: local-uninstall
146         $(LOOP)
147
148 local-uninstall:
149
150 installextradoc:
151         -$(INSTALLPY) -d $(DESTDIR)$(prefix)/doc/$(package)
152         cp -r $(EXTRA_DOC_FILES) $(prefix)/doc/$(package)
153
154 -include $(outdir)/dummy.dep $(wildcard $(outdir)/*.dep)
155
156 $(outdir)/dummy.dep:
157         -mkdir -p $(outdir)
158         touch $(outdir)/dummy.dep
159         echo '*' > $(outdir)/.gitignore
160
161 check: local-check
162         $(LOOP)
163
164 local-check:
165
166 # ugh.  ugh ugh ugh
167 $(config_make): $(top-src-dir)/configure
168         @echo "************************************************************"
169         @echo "configure changed! You should probably reconfigure manually."
170         @echo "************************************************************"
171         (cd $(top-build-dir); ./config.status)
172         touch $@                # do something for multiple simultaneous configs.
173
174
175 #### Documentation (website and tarball)
176
177 # documentation is built in two stages,
178 # plus WWW-post (only at toplevel)
179 # see INSTALL for more information.
180
181 ifeq ($(out),www)
182 local-WWW-1:
183 local-WWW-2:
184 WWW-post:
185
186 WWW-1: local-WWW-1
187         $(LOOP)
188
189 WWW-2: local-WWW-2
190         $(LOOP)
191 endif
192
193 doc: doc-stage-1
194         $(MAKE) out=www WWW-2
195         $(MAKE) out=www WWW-post
196
197 local-doc:
198         $(MAKE) out=www local-WWW-1
199         $(MAKE) out=www local-WWW-2
200         $(MAKE) out=www WWW-post
201
202 doc-stage-1:
203         $(MAKE) -C $(depth)/scripts/build out=
204         $(MAKE) out=www WWW-1
205
206 doc-clean:
207         $(MAKE) out=www clean