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