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