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