]> git.donarmstrong.com Git - lilypond.git/blob - make/Targets.make
patch::: 0.1.22.jcn1: rust
[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 $@
61 #       ln -sf $(outdir)/$(LIB_PREFIX)$(NAME).so.$(VERSION) $(outdir)/$(LIB_PREFIX)$(NAME).so
62 #
63 lib: $(LIBRARY)
64 #
65
66 # be careful about deletion.
67 clean: localclean
68         rm -f core 
69 ifdef EXECUTABLE
70         rm -f $(EXECUTABLE)
71 endif
72 ifdef OFILES
73         rm -f $(OFILES)
74 endif
75 ifdef DEPFILES
76         rm -f $(DEPFILES)
77 endif
78 ifdef SUBDIRS
79         set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean; done
80 endif
81
82 # configure:
83 #
84 config:
85         ./$(depth)/configure
86 #
87
88 # dummydeps:
89 #
90 dummydep: $(DUMMYDEPS)
91 #
92
93 # value of $(OSTYPE) on windhoos...; "make $OSTYPE" if you use bash :-)
94 #
95 win32:  windows32 # win/lose?
96 #
97 windows32:
98         $(MAKE) -C . "CXX=g++ -D_WINDOWS32"
99 #
100
101 # xcompile to doze:
102 #
103 doze:   dos
104 dos: 
105         $(MAKE) -C . CXX="gcc-go32 -I/usr/i386-go32/include -I/usr/i386-go32/include/g++ -D_WINDOWS32 -Dcaddr_t=char* -DMAP_SHARED=0"
106 #
107
108 # target help:
109 #
110 help:
111         @echo "Usage:"
112         @echo " $(MAKE) ["VARIABLE=value" ...] [target]"
113         @echo
114         @echo "targets:"
115         @echo " all clean config dist distclean doc doc++"
116         @echo " exe help lib moduledist TAGS"
117         @echo " dos:    xcomplile to dos"
118         @echo " windows32: native cygnus-gnu compile" 
119 #
120
121 doc:
122         $(MAKE) -C $(depth)/Documentation do-doc
123
124
125 # ugh. should generate in out/
126 dist:
127         -mkdir $(distdir)
128         $(MAKE) localdist
129         chmod -Rf a+rX $(distdir)
130
131         (cd ./$(depth); $(TAR) cf - $(DIST_NAME) | gzip -9 > $(DIST_NAME).tar.gz)
132
133 # should be trapped
134         rm -rf $(distdir)/
135
136 # ugh. should generate in out/
137 dozedist: doosdist
138 doosdist:
139         -mkdir $(distdir)
140 #       nogo, SUBDIRS is handed down to subdir...
141 #       $(MAKE) SUBDIRS="Documentation init input tex" localdist
142         $(MAKE) localdist
143         chmod -Rf a+rX $(distdir)
144 #       ugh, the ugly way, then
145         (cd $(distdir); rm -rf $(NO_DOOS_DIST))
146         cp $(lilyout)/lilypond.exe $(distdir)
147         strip -s $(distdir)/lilypond.exe
148         cp $(mi2muout)/mi2mu.exe $(distdir)
149         strip -s $(distdir)/mi2mu.exe
150         (cd ./$(depth); $(ZIP) $(DIST_NAME).exe.zip $(distdir))
151 # should be trapped
152         rm -rf $(distdir)/
153
154
155 localdist: $(DISTFILES)
156         if [ -d out ]; then mkdir $(distdir)/$(localdir)/out; fi
157         $(LN) $(DISTFILES) $(distdir)/$(localdir)
158 ifdef SUBDIRS
159         set -e; for i in $(SUBDIRS); do mkdir $(distdir)/$(localdir)/$$i; \
160                 $(MAKE) localdir=$(localdir)/$$i -C $$i localdist; done
161 endif
162
163 moduledist:
164         -mkdir $(module-distdir)
165         $(MAKE) localmoduledist
166         (cd ./$(depth); $(TAR) cfz $(MODULE_DIST_NAME).tar.gz $(MODULE_DIST_NAME))
167         rm -rf $(module-distdir)/ 
168
169 localmoduledist:
170         $(LN) $(DISTFILES) $(module-distdir)/$(localdir)
171 ifdef SUBDIRS
172         set -e; for i in $(SUBDIRS); do mkdir $(module-distdir)/$(localdir)/$$i; done
173         set -e; for i in $(SUBDIRS); do $(MAKE) localdir=$(localdir)/$$i -C $$i localmoduledist; done
174 endif
175
176 TAGS:$(all-tag-sources)
177 ifdef all-tag-sources
178         -etags -CT $(all-tag-sources) $(ERROR_LOG)
179         -ctags -CT $(all-tag-sources) $(ERROR_LOG)
180 endif
181 ifdef SUBDIRS
182         set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i TAGS ; done
183 endif
184
185
186 # version stuff:
187 #
188
189 $(outdir)/version.hh: VERSION
190         sh ./$(lily_bindir)/make-version.sh > $@
191
192
193 # should this be in Rules?
194 configure: configure.in aclocal.m4
195         autoconf - < $<> $@
196         chmod +x configure
197
198 localclean:
199
200 install-strip:
201         $(MAKE) INSTALL="$(INSTALL) -s" install
202
203 install: localinstall
204 ifdef SUBDIRS
205         set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install; done
206 endif
207
208 localinstall:
209
210 uninstall: localuninstall
211 ifdef SUBDIRS
212         set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i uninstall; done
213 endif
214
215 localuninstall:
216
217 # specific stuff:
218 #
219 $(LIBFLOWER): check-flower-deps
220
221 check-flower-deps:
222         $(MAKE)  -C $(depth)/flower/ default
223
224 check-lib-deps: check-flower-deps
225         $(MAKE)  -C $(depth)/lib
226
227 check-doc-deps:
228         $(MAKE) -C $(depth)/Documentation
229
230 $(LIBLILY): dummy
231         $(MAKE) ./$(outdir)/$(@F) -C $(depth)/lib
232
233
234 # RedHat rpm package:
235 #
236 rpm: check-rpm-doc-deps
237         -cp $(depth)/lilypond-$(TOPLEVEL_VERSION).tar.gz $(rpm-sources)
238 #       -cp $(wildcard $(depth)/Documentation/*.xpm) $(rpm-sources)
239         -cp $(wildcard $(depth)/Documentation/$(outdir)/*.gif) $(rpm-sources)
240         $(MAKE) -C $(make-dir) spec
241         rpm -ba $(makeout)/lilypond.spec
242
243 check-rpm-doc-deps: 
244         $(MAKE) -C $(depth)/Documentation gifs
245
246
247 installexe:
248         $(INSTALL) -d $(bindir)
249         $(INSTALL) -m 755 $(EXECUTABLES) $(bindir)
250
251 uninstallexe:
252         for a in $(EXECUTABLES); do rm -f $(bindir)/`basename $$a`; done
253
254 ifneq ($(DEPFILES),)
255 include $(DEPFILES)
256 endif