]> git.donarmstrong.com Git - lilypond.git/blob - make/Targets.make
release: 0.1.45
[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 -Rf a+rX $(distdir)
133
134         (cd ./$(depth)/$(outdir); $(TAR) cf - $(DIST_NAME) | gzip -9 > $(DIST_NAME).tar.gz)
135
136 # should be trapped
137         rm -rf $(distdir)/
138
139 # ugh. should generate in out/
140 dozedist: doosdist
141 doosdist:
142         -mkdir $(distdir)
143 #       nogo, SUBDIRS is handed down to subdir...
144 #       $(MAKE) SUBDIRS="Documentation init input tex" localdist
145         $(MAKE) localdist
146         chmod -Rf a+rX $(distdir)
147 #       ugh, the ugly way, then
148         (cd $(distdir); rm -rf $(NO_DOOS_DIST))
149         cp $(lilyout)/lilypond.exe $(distdir)
150         strip -s $(distdir)/lilypond.exe
151         cp $(mi2muout)/mi2mu.exe $(distdir)
152         strip -s $(distdir)/mi2mu.exe
153         (cd ./$(depth); $(ZIP) $(DIST_NAME).exe.zip $(distdir))
154 # should be trapped
155         rm -rf $(distdir)/
156
157
158 localdist: $(DISTFILES)
159         if [ -d out ]; then \
160                 mkdir $(distdir)/$(localdir)/out; \
161                 touch $(distdir)/$(localdir)/out/dummy.dep; \
162         fi
163         $(LN) $(DISTFILES) $(distdir)/$(localdir)
164 ifdef SUBDIRS
165         set -e; for i in $(SUBDIRS); do mkdir $(distdir)/$(localdir)/$$i; \
166                 $(MAKE) localdir=$(localdir)/$$i -C $$i localdist; done
167 endif
168
169 moduledist:
170         -mkdir $(module-distdir)
171         $(MAKE) localmoduledist
172         (cd $(depth)/$(outdir); $(TAR) cfz $(MODULE_DIST_NAME).tar.gz $(MODULE_DIST_NAME))
173         rm -rf $(module-distdir)/ 
174
175 localmoduledist:
176         $(LN) $(DISTFILES) $(module-distdir)/$(localdir)
177 ifdef SUBDIRS
178         set -e; for i in $(SUBDIRS); do mkdir $(module-distdir)/$(localdir)/$$i; done
179         set -e; for i in $(SUBDIRS); do $(MAKE) localdir=$(localdir)/$$i -C $$i localmoduledist; done
180 endif
181
182 TAGS:$(all-tag-sources)
183 ifdef all-tag-sources
184         -etags -CT $(all-tag-sources) $(ERROR_LOG)
185         -ctags -CT $(all-tag-sources) $(ERROR_LOG)
186 endif
187 ifdef SUBDIRS
188         set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i TAGS ; done
189 endif
190
191
192 # version stuff:
193 #
194
195 $(outdir)/version.hh: VERSION
196         sh ./$(lily_bindir)/make-version.sh > $@
197
198
199 # should this be in Rules?
200 configure: configure.in aclocal.m4
201         autoconf - < $<> $@
202         chmod +x configure
203
204 localclean:
205
206 install-strip:
207         $(MAKE) INSTALL="$(INSTALL) -s" install
208
209 install: localinstall
210 ifdef SUBDIRS
211         set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install; done
212 endif
213
214 localinstall:
215
216 uninstall: localuninstall
217 ifdef SUBDIRS
218         set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i uninstall; done
219 endif
220
221 localuninstall:
222
223 # specific stuff:
224 #
225 $(LIBFLOWER): check-flower-deps
226
227 check-flower-deps:
228         $(MAKE)  -C $(depth)/flower/ default
229
230 check-lib-deps: check-flower-deps
231         $(MAKE)  -C $(depth)/lib
232
233 check-doc-deps:
234         $(MAKE) -C $(depth)/Documentation
235
236 $(LIBLILY): dummy
237         $(MAKE) ./$(outdir)/$(@F) -C $(depth)/lib
238
239
240 # RedHat rpm package:
241 #
242 rpm: check-rpm-doc-deps
243         -cp $(depth)/lilypond-$(TOPLEVEL_VERSION).tar.gz $(rpm-sources)
244 #       -cp $(wildcard $(depth)/Documentation/*.xpm) $(rpm-sources)
245         -cp $(wildcard $(depth)/Documentation/$(outdir)/*.gif) $(rpm-sources)
246         $(MAKE) -C $(make-dir) spec
247         rpm -ba $(makeout)/lilypond.spec
248
249 check-rpm-doc-deps: 
250         $(MAKE) -C $(depth)/Documentation gifs
251
252 check-mf-deps:
253         $(MAKE) -C $(depth)/mf
254
255
256
257 installexe:
258         $(INSTALL) -d $(bindir)
259         $(INSTALL) -m 755 $(EXECUTABLES) $(bindir)
260
261 uninstallexe:
262         for a in $(EXECUTABLES); do rm -f $(bindir)/`basename $$a`; done
263
264 ifneq ($(DEPFILES),)
265 include $(DEPFILES)
266 endif