]> git.donarmstrong.com Git - lilypond.git/blob - make/Targets.make
release: 0.0.78
[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 localdist: $(DISTFILES)
140         if [ -d out ]; then mkdir $(distdir)/$(localdir)/out; fi
141         ln $(DISTFILES) $(distdir)/$(localdir)
142 ifdef SUBDIRS
143         set -e; for i in $(SUBDIRS); do mkdir $(distdir)/$(localdir)/$$i; \
144                 $(MAKE) localdir=$(localdir)/$$i -C $$i localdist; done
145 endif
146
147 moduledist:
148         -mkdir $(module-distdir)
149         $(MAKE) localmoduledist
150         (cd ./$(depth); $(TAR) cfz $(MODULE_DIST_NAME).tar.gz $(MODULE_DIST_NAME))
151         rm -rf $(module-distdir)/ 
152
153 localmoduledist:
154         ln $(DISTFILES) $(module-distdir)/$(localdir)
155 ifdef SUBDIRS
156         set -e; for i in $(SUBDIRS); do mkdir $(module-distdir)/$(localdir)/$$i; done
157         set -e; for i in $(SUBDIRS); do $(MAKE) localdir=$(localdir)/$$i -C $$i localmoduledist; done
158 endif
159
160 TAGS:$(all-tag-sources)
161 ifdef all-tag-sources
162         -etags -CT $(all-tag-sources) $(ERROR_LOG)
163         -ctags -CT $(all-tag-sources) $(ERROR_LOG)
164 endif
165 ifdef SUBDIRS
166         set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i TAGS ; done
167 endif
168
169
170 # version stuff:
171 #
172
173 $(outdir)/version.hh: VERSION
174         ./$(lily_bindir)/make-version > $@
175
176
177 # should this be in Rules?
178 configure: configure.in
179         autoconf - < $<> $@
180         chmod +x configure
181
182 localclean:
183
184
185 install: localinstall
186 ifdef SUBDIRS
187         set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install; done
188 endif
189
190 localinstall:
191
192 uninstall: localuninstall
193 ifdef SUBDIRS
194         set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i uninstall; done
195 endif
196
197 localuninstall:
198
199 # specific stuff:
200 #
201 $(LIBFLOWER): check-flower-deps
202
203 check-flower-deps:
204         $(MAKE)  -C $(depth)/flower/ default
205
206 check-lily-deps: check-flower-deps
207         $(MAKE)  -C $(depth)/lib
208
209 check-doc-deps:
210         $(MAKE) -C $(depth)/Documentation
211
212 $(LIBLILY): dummy
213         $(MAKE) ./$(outdir)/$(@F) -C $(depth)/lib
214
215
216 # RedHat rpm package:
217 #
218 rpm: check-rpm-doc-deps
219         -cp $(depth)/lilypond-$(TOPLEVEL_VERSION).tar.gz $(rpm-sources)
220         -cp $< $(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/ xpms
226
227
228 installexe:
229         $(INSTALL) -d $(bindir)
230         $(INSTALL) -m 755 $(EXECUTABLES) $(bindir)
231
232 uninstallexe:
233         for a in $(EXECUTABLES); do rm -f $(bindir)/`basename $$a`; done
234
235 ifneq ($(DEPFILES),)
236 include $(DEPFILES)
237 endif