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