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