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