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