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