]> git.donarmstrong.com Git - lilypond.git/blob - make/Targets.make
1795fd7a41421433f0dbc019715de49f798d9c9c
[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
45 $(build): $(depth)/.version
46         echo 0 > $@
47
48 # dependency list of library:
49 #
50 LIBRARY = $(outdir)/$(LIB_PREFIX)$(NAME).a
51 $(LIBRARY): $(build) $(OFILES)
52         $(INCREASE_BUILD)
53         $(MAKE) $(OFILES)  $(SILENT_LOG)
54         $(AR_COMMAND) $(OFILES)
55         $(RANLIB_COMMAND)
56
57 SHAREDLIBRARY=$(outdir)/$(LIB_PREFIX)$(NAME).so
58 $(SHAREDLIBRARY):  $(build) $(OFILES) $(MODULE_LIBDEPS)
59         $(INCREASE_BUILD)
60         $(MAKE) $(OFILES)  $(SILENT_LOG)
61         $(LD_COMMAND) $(OFILES) -o $@
62 #       ln -sf $(outdir)/$(LIB_PREFIX)$(NAME).so.$(VERSION) $(outdir)/$(LIB_PREFIX)$(NAME).so
63 #
64 lib: $(LIBRARY)
65 #
66 TOCLEAN= $(allobs) $(alldeps)
67
68 # be careful about deletion.
69 clean: localclean
70         rm -f core 
71 ifdef EXECUTABLE
72         rm -f $(EXECUTABLE)
73 endif
74 ifdef allobs
75         rm -f $(allobs)
76 endif
77 ifdef alldeps
78         rm -f $(alldeps)
79 endif
80 ifdef SUBDIRS
81         set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean; done
82 endif
83
84 distclean: localdistclean 
85 ifdef SUBDIRS
86         set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i localdistclean; done
87 endif
88
89 localdistclean:
90
91
92 # configure:
93 #
94 config:
95         ./$(depth)/configure
96 #
97
98 # dummydeps:
99 #
100 dummydep: $(DUMMYDEPS)
101 #
102
103 # value of $(OSTYPE) on windhoos...; "make $OSTYPE" if you use bash :-)
104 #
105 win32:  windows32 # win/lose?
106 #
107 windows32:
108         $(MAKE) -C . "CXX=g++ -D_WINDOWS32"
109 #
110
111 # xcompile to doze:
112 #
113 doze:   dos
114 dos: 
115         $(MAKE) -C . CXX="gcc-go32 -I/usr/i386-go32/include -I/usr/i386-go32/include/g++ -D_WINDOWS32 -Dcaddr_t=char* -DMAP_SHARED=0"
116 #
117
118 # target help:
119 #
120 help:
121         @echo "Usage:"
122         @echo " $(MAKE) ["VARIABLE=value" ...] [target]"
123         @echo
124         @echo "targets:"
125         @echo " all clean config dist distclean doc doc++"
126         @echo " exe help lib moduledist TAGS"
127         @echo " dos:    xcomplile to dos"
128         @echo " windows32: native cygnus-gnu compile" 
129 #
130
131 doc:
132         $(MAKE) -C $(depth)/Documentation do-doc
133
134 # doc++ documentation of classes
135 doc++: $(progdocs)      
136         doc++ -k -p -d $(DOCDIR) $^
137
138 dist:
139         -mkdir $(distdir)
140         $(MAKE) localdist
141         chmod -Rf a+rX $(distdir)
142
143         (cd ./$(depth); $(TAR) cf $(DIST_NAME).tar $(DIST_NAME);)
144         (cd $(depth); gzip -9 $(DIST_NAME).tar)
145 # should be trapped
146         rm -rf $(distdir)/
147
148 localdist: $(DISTFILES)
149         if [ -d out ]; then mkdir $(distdir)/$(localdir)/out; fi
150         ln $(DISTFILES) $(distdir)/$(localdir)
151 ifdef SUBDIRS
152         set -e; for i in $(SUBDIRS); do mkdir $(distdir)/$(localdir)/$$i; \
153                 $(MAKE) localdir=$(localdir)/$$i -C $$i localdist; done
154 endif
155
156 moduledist:
157         -mkdir $(module-distdir)
158         $(MAKE) localmoduledist
159         (cd ./$(depth); $(TAR) cfz $(MODULE_DIST_NAME).tar.gz $(MODULE_DIST_NAME))
160         rm -rf $(module-distdir)/ 
161
162 localmoduledist:
163         ln $(DISTFILES) $(module-distdir)/$(localdir)
164 ifdef SUBDIRS
165         set -e; for i in $(SUBDIRS); do mkdir $(module-distdir)/$(localdir)/$$i; done
166         set -e; for i in $(SUBDIRS); do $(MAKE) localdir=$(localdir)/$$i -C $$i localmoduledist; done
167 endif
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         ./$(lily_bindir)/make_version > $@
184
185
186 # should this be in Rules?
187 configure: configure.in
188         autoconf - < $<> $@
189         chmod +x configure
190
191 localclean:
192
193
194 install: localinstall
195 ifdef SUBDIRS
196         set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install; done
197 endif
198
199 localinstall:
200
201 uninstall: localuninstall
202 ifdef SUBDIRS
203         set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i uninstall; done
204 endif
205
206 localuninstall:
207
208 # specific stuff:
209 #
210 $(LIBFLOWER): check-flower-deps
211
212 check-flower-deps:
213         $(MAKE)  -C $(depth)/flower/ default
214
215 check-lily-deps: check-flower-deps
216         $(MAKE)  -C $(depth)/lib
217
218 check-doc-deps:
219         $(MAKE) -C $(depth)/Documentation
220
221 $(LIBLILY): dummy
222         $(MAKE) ./$(outdir)/$(@F) -C $(depth)/lib
223 #
224
225 # RedHat rpm package:
226 #
227 rpm: check-rpm-doc-deps
228         -cp $(depth)/lilypond-$(TOPLEVEL_VERSION).tar.gz $(rpm-sources)
229         -cp $< $(rpm-sources)
230         $(MAKE) -C $(make-dir) spec
231         rpm -ba $(makeout)/lilypond.spec
232 #
233 check-rpm-doc-deps: 
234         $(MAKE) -C $(depth)/Documentation/ xpms
235
236
237 installexe:
238         $(INSTALL) -d $(bindir)
239         $(INSTALL) -m 755 $(EXECUTABLES) $(bindir)
240
241 uninstallexe:
242         for a in $(EXECUTABLES); do rm -f $(bindir)/`basename $$a`; done
243
244 ifneq ($(DEPFILES),)
245 include $(DEPFILES)
246 endif