]> git.donarmstrong.com Git - lilypond.git/blob - make/Targets.make
release: 0.1.59
[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         $(RANLIB_COMMAND)
37
38 $(SHAREDLIBRARY):  $(configheader) $(OFILES) $(MODULE_LIBDEPS)
39         $(LD_COMMAND) $(OFILES) -o $@.$(VERSION)
40         rm -f $@
41         ln -sf $(outdir)/$(LIB_PREFIX)$(NAME).so.$(VERSION) $@.$(MAJOR_VERSION)
42         ln -sf $(LIB_PREFIX)$(NAME).so.$(VERSION) $@
43
44 #
45 lib: $(LIBRARY)
46 #
47
48
49 outdirs: outdir
50         $(LOOP)
51
52 outdir:
53         -mkdir $(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
115
116 # ugh. should generate in out/
117 dist:
118         rm -rf $(distdir)
119         -mkdir $(distdir)
120         $(MAKE) localdist
121         chmod -R a+r $(distdir)
122         chmod  a+x `find $(distdir) -type d -print`
123
124         (cd ./$(depth)/$(outdir); $(TAR) cf - $(DIST_NAME) | gzip -9 > $(DIST_NAME).tar.gz)
125
126 # should be trapped
127         rm -rf $(distdir)/
128
129 # ugh. should generate in out/
130 dozedist: doosdist
131 doosdist:
132         -mkdir $(distdir)
133 #       nogo, SUBDIRS is handed down to subdir...
134 #       $(MAKE) SUBDIRS="Documentation init input tex" localdist
135         $(MAKE) localdist
136         chmod -Rf a+rX $(distdir)
137 #       ugh, the ugly way, then
138         (cd $(distdir); rm -rf $(NO_DOOS_DIST))
139         cp $(lilyout)/lilypond.exe $(distdir)
140         strip -s $(distdir)/lilypond.exe
141         cp $(mi2muout)/mi2mu.exe $(distdir)
142         strip -s $(distdir)/mi2mu.exe
143         (cd ./$(depth); $(ZIP) $(DIST_NAME).exe.zip $(distdir))
144 # should be trapped
145         rm -rf $(distdir)/
146
147
148 localdist: $(DISTFILES) $(OUT_DISTFILES)
149         touch $(outdir)/dummy.dep; \
150         mkdir $(distdir)/$(localdir)/out; \
151         $(LN) $(DISTFILES) $(distdir)/$(localdir)
152         $(LN) $(outdir)/dummy.dep $(OUT_DISTFILES) $(distdir)/$(localdir)/out
153 ifdef SUBDIRS
154         set -e; for i in $(SUBDIRS); do mkdir $(distdir)/$(localdir)/$$i; \
155                 $(MAKE) localdir=$(localdir)/$$i -C $$i localdist; done
156 endif
157
158
159 TAGS:$(all-tag-sources)
160 ifdef all-tag-sources
161         -etags -CT $(all-tag-sources) $(ERROR_LOG)
162         -ctags -CT $(all-tag-sources) $(ERROR_LOG)
163 endif
164         $(LOOP)
165
166
167 # version stuff:
168 #
169
170 $(outdir)/version.hh: VERSION
171         sh ./$(lily_bindir)/make-version.sh > $@
172
173
174 # should this be in Rules?
175 configure: configure.in aclocal.m4
176         autoconf - < $<> $@
177         chmod +x configure
178
179 localclean:
180
181 local-distclean:
182
183 local-maintainerclean:
184
185 install-strip:
186         $(MAKE) INSTALL="$(INSTALL) -s" install
187
188 install: localinstall
189         $(LOOP)
190
191 localinstall:
192
193 uninstall: localuninstall
194         $(LOOP)
195
196 localuninstall:
197
198 # specific stuff:
199 #
200 $(LIBFLOWER): check-flower-deps
201
202 check-flower-deps:
203         $(MAKE)  -C $(depth)/flower/ default
204
205 check-lib-deps: check-flower-deps
206         $(MAKE)  -C $(depth)/lib
207
208 check-doc-deps:
209         $(MAKE) -C $(depth)/Documentation
210
211 $(LIBLILY): dummy
212         $(MAKE) ./$(outdir)/$(@F) -C $(depth)/lib
213
214
215 # RedHat rpm package:
216 #
217 rpm: check-rpm-doc-deps
218         -cp $(depth)/lilypond-$(TOPLEVEL_VERSION).tar.gz $(rpm-sources)
219 #       -cp $(wildcard $(depth)/Documentation/*.xpm) $(rpm-sources)
220         -cp $(wildcard $(depth)/Documentation/$(outdir)/*.gif) $(rpm-sources)
221         $(MAKE) -C $(make-dir) spec
222         rpm -ba $(makeout)/lilypond.spec
223
224 check-rpm-doc-deps: 
225         $(MAKE) -C $(depth)/Documentation gifs
226
227 check-mf-deps:
228         $(MAKE) -C $(depth)/mf
229
230 $(configheader): $(depth)/$(configuration).hh
231         cp $< $@
232
233
234
235 ifneq ($(DEPFILES),)
236 include $(DEPFILES)
237 endif