]> git.donarmstrong.com Git - lilypond.git/blob - make/Targets.make
release: 0.1.48
[lilypond.git] / make / Targets.make
1 #
2 # project  LilyPond -- the musical typesetter
3 # title    generic make targets
4 # file     make/Targets.make
5 #
6 # Copyright (c) 1997 by    
7 #       Jan Nieuwenhuizen <jan@digicash.com>
8 #       Han-Wen Nienhuys <hanwen@stack.nl>
9
10 .PHONY : all clean config default dist doc doc++ dummy exe help lib TAGS html\
11         check-flower-deps check-lib-deps check-doc-deps
12
13 # target all:
14 #
15 all:     default
16 ifdef SUBDIRS
17         set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i all; done
18 endif
19
20 #
21
22 # platform specific variables,
23 #
24 include ./$(depth)/make/out/Site.make
25 #
26
27 # where to do this ?
28 .PRECIOUS:  $(makeout)/Site.make
29
30 # dependency list of executable:
31 #
32
33 $(EXECUTABLE): $(build) $(OFILES) $(outdir)/version.hh
34         $(MAKE) $(MODULE_LIBDEPS) 
35         $(INCREASE_BUILD)
36         $(MAKE) -S $(OFILES)  $(SILENT_LOG)
37 ifdef STABLEOBS
38         $(DO_STRIP) $(STABLEOBS)
39 endif
40         $(LD_COMMAND) $(OFILES) $(LOADLIBES)
41
42 exe: $(EXECUTABLE)
43
44 $(build): $(depth)/VERSION
45         echo 0 > $@
46
47 # dependency list of library:
48 #
49 LIBRARY = $(outdir)/$(LIB_PREFIX)$(NAME).a
50 $(LIBRARY): $(build) $(OFILES)
51         $(INCREASE_BUILD)
52         $(MAKE) $(OFILES)  $(SILENT_LOG)
53         $(AR_COMMAND) $(OFILES)
54         $(RANLIB_COMMAND)
55
56 SHAREDLIBRARY=$(outdir)/$(LIB_PREFIX)$(NAME).so
57 $(SHAREDLIBRARY):  $(build) $(OFILES) $(MODULE_LIBDEPS)
58         $(INCREASE_BUILD)
59         $(MAKE) $(OFILES)  $(SILENT_LOG)
60         $(LD_COMMAND) $(OFILES) -o $@.$(VERSION)
61         rm -f $@
62         ln -sf $(outdir)/$(LIB_PREFIX)$(NAME).so.$(VERSION) $@.$(MAJOR_VERSION)
63         ln -sf $(LIB_PREFIX)$(NAME).so.$(VERSION) $@
64
65 #
66 lib: $(LIBRARY)
67 #
68
69 # be careful about deletion.
70 clean: localclean
71         rm -f core 
72 ifdef EXECUTABLE
73         rm -f $(EXECUTABLE)
74 endif
75 ifdef OFILES
76         rm -f $(OFILES)
77 endif
78 ifdef DEPFILES
79         rm -f $(DEPFILES)
80 endif
81 ifdef SUBDIRS
82         set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean; done
83 endif
84
85 # configure:
86 #
87 config:
88         ./$(depth)/configure
89 #
90
91 # dummydeps:
92 #
93 dummydep: $(DUMMYDEPS)
94 #
95
96 # value of $(OSTYPE) on windhoos...; "make $OSTYPE" if you use bash :-)
97 #
98 win32:  windows32 # win/lose?
99 #
100 windows32:
101         $(MAKE) -C . "CXX=g++ -D_WINDOWS32"
102 #
103
104 # xcompile to doze:
105 #
106 doze:   dos
107 dos: 
108         $(MAKE) -C . CXX="gcc-go32 -I/usr/i386-go32/include -I/usr/i386-go32/include/g++ -D_WINDOWS32 -Dcaddr_t=char* -DMAP_SHARED=0"
109 #
110
111 # target help:
112 #
113 help:
114         @echo "Usage:"
115         @echo " $(MAKE) ["VARIABLE=value" ...] [target]"
116         @echo
117         @echo "targets:"
118         @echo " all clean config dist distclean doc doc++"
119         @echo " exe help lib moduledist TAGS"
120         @echo " dos:    xcomplile to dos"
121         @echo " windows32: native cygnus-gnu compile" 
122 #
123
124 doc:
125         $(MAKE) -C $(depth)/Documentation do-doc
126
127
128 # ugh. should generate in out/
129 dist:
130         -mkdir $(distdir)
131         $(MAKE) localdist
132         chmod -R a+r $(distdir)
133         chmod  a+x `find $(distdir) -type d -print`
134
135         (cd ./$(depth)/$(outdir); $(TAR) cf - $(DIST_NAME) | gzip -9 > $(DIST_NAME).tar.gz)
136
137 # should be trapped
138         rm -rf $(distdir)/
139
140 # ugh. should generate in out/
141 dozedist: doosdist
142 doosdist:
143         -mkdir $(distdir)
144 #       nogo, SUBDIRS is handed down to subdir...
145 #       $(MAKE) SUBDIRS="Documentation init input tex" localdist
146         $(MAKE) localdist
147         chmod -Rf a+rX $(distdir)
148 #       ugh, the ugly way, then
149         (cd $(distdir); rm -rf $(NO_DOOS_DIST))
150         cp $(lilyout)/lilypond.exe $(distdir)
151         strip -s $(distdir)/lilypond.exe
152         cp $(mi2muout)/mi2mu.exe $(distdir)
153         strip -s $(distdir)/mi2mu.exe
154         (cd ./$(depth); $(ZIP) $(DIST_NAME).exe.zip $(distdir))
155 # should be trapped
156         rm -rf $(distdir)/
157
158
159 localdist: $(DISTFILES)
160         if [ -d out ]; then \
161                 mkdir $(distdir)/$(localdir)/out; \
162                 touch $(distdir)/$(localdir)/out/dummy.dep; \
163         fi
164         $(LN) $(DISTFILES) $(distdir)/$(localdir)
165 ifdef SUBDIRS
166         set -e; for i in $(SUBDIRS); do mkdir $(distdir)/$(localdir)/$$i; \
167                 $(MAKE) localdir=$(localdir)/$$i -C $$i localdist; done
168 endif
169
170 moduledist:
171         -mkdir $(module-distdir)
172         $(MAKE) localmoduledist
173         (cd $(depth)/$(outdir); $(TAR) cfz $(MODULE_DIST_NAME).tar.gz $(MODULE_DIST_NAME))
174         rm -rf $(module-distdir)/ 
175
176 localmoduledist:
177         $(LN) $(DISTFILES) $(module-distdir)/$(localdir)
178 ifdef SUBDIRS
179         set -e; for i in $(SUBDIRS); do mkdir $(module-distdir)/$(localdir)/$$i; done
180         set -e; for i in $(SUBDIRS); do $(MAKE) localdir=$(localdir)/$$i -C $$i localmoduledist; done
181 endif
182
183 TAGS:$(all-tag-sources)
184 ifdef all-tag-sources
185         -etags -CT $(all-tag-sources) $(ERROR_LOG)
186         -ctags -CT $(all-tag-sources) $(ERROR_LOG)
187 endif
188 ifdef SUBDIRS
189         set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i TAGS ; done
190 endif
191
192
193 # version stuff:
194 #
195
196 $(outdir)/version.hh: VERSION
197         sh ./$(lily_bindir)/make-version.sh > $@
198
199
200 # should this be in Rules?
201 configure: configure.in aclocal.m4
202         autoconf - < $<> $@
203         chmod +x configure
204
205 localclean:
206
207 install-strip:
208         $(MAKE) INSTALL="$(INSTALL) -s" install
209
210 install: localinstall
211 ifdef SUBDIRS
212         set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install; done
213 endif
214
215 localinstall:
216
217 uninstall: localuninstall
218 ifdef SUBDIRS
219         set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i uninstall; done
220 endif
221
222 localuninstall:
223
224 # specific stuff:
225 #
226 $(LIBFLOWER): check-flower-deps
227
228 check-flower-deps:
229         $(MAKE)  -C $(depth)/flower/ default
230
231 check-lib-deps: check-flower-deps
232         $(MAKE)  -C $(depth)/lib
233
234 check-doc-deps:
235         $(MAKE) -C $(depth)/Documentation
236
237 $(LIBLILY): dummy
238         $(MAKE) ./$(outdir)/$(@F) -C $(depth)/lib
239
240
241 # RedHat rpm package:
242 #
243 rpm: check-rpm-doc-deps
244         -cp $(depth)/lilypond-$(TOPLEVEL_VERSION).tar.gz $(rpm-sources)
245 #       -cp $(wildcard $(depth)/Documentation/*.xpm) $(rpm-sources)
246         -cp $(wildcard $(depth)/Documentation/$(outdir)/*.gif) $(rpm-sources)
247         $(MAKE) -C $(make-dir) spec
248         rpm -ba $(makeout)/lilypond.spec
249
250 check-rpm-doc-deps: 
251         $(MAKE) -C $(depth)/Documentation gifs
252
253 check-mf-deps:
254         $(MAKE) -C $(depth)/mf
255
256
257
258 installexe:
259         $(INSTALL) -d $(bindir)
260         $(INSTALL) -m 755 $(EXECUTABLES) $(bindir)
261
262 uninstallexe:
263         for a in $(EXECUTABLES); do rm -f $(bindir)/`basename $$a`; done
264
265 ifneq ($(DEPFILES),)
266 include $(DEPFILES)
267 endif