]> git.donarmstrong.com Git - lilypond.git/blob - make/Rules.make
e574fb4ee15786790310290df17cf43a01a07e28
[lilypond.git] / make / Rules.make
1 #
2 # project  LilyPond -- the musical typesetter
3 # title    generic make rules
4 # file     make/Rules.make
5 #
6 # Copyright (c) 1997 by    
7 #       Jan Nieuwenhuizen <jan@digicash.com>
8 #       Han-Wen Nienhuys <hanwen@stack.nl>
9
10 # this is supposed to clear all suffixes:
11 .SUFFIXES:
12 # so why does make still consider xx.y : RCS/xx.y,v ?
13 # there is no suffix ,v anymore!
14 .SUFFIXES: .cc .o .hh .y .l .pod .txt .1 .dep
15
16 # cancel implicit rules:
17 #
18 # shit, how to get rid of these stupid built-in rules?
19 # include ./$(depth)/make/Builtin-rules.make
20 #
21
22 # compile rules:
23 #
24 $(outdir)/%.o: %.cc $(genout)
25         $(DODEP)\
26         $(CXX) -c $(CXXFLAGS) $(CXX_OUTPUT_OPTION) 
27
28 $(outdir)/%.cc: %.y $(genout)
29 #       $(BISON) -d $<
30         $(BISON) $<
31 #       mv $(shell basename $@ .cc ).tab.h $(include-lib)/$(shell basename $@ .cc).hh
32 #       mv $(shell basename $@ .cc ).tab.h $(outdir)/$(shell basename $@ .cc).hh
33         mv $(shell basename $@ .cc ).tab.c $@
34
35 $(outdir)/%.hh: %.y $(genout)
36         $(BISON) -d $<
37         mv $(shell basename $@ .hh ).tab.h $@
38         mv $(shell basename $@ .hh ).tab.c $(outdir)/$(shell basename $@ .hh).cc
39
40 $(outdir)/%.cc: %.l $(genout)
41         $(FLEX)  -t $< > $@
42
43 $(outdir)/%.text: $(outdir)/%.1
44         groff -man -Tascii $< > $@
45
46 $(outdir)/%.1: %.pod $(genout)
47         pod2man --center="LilyPond documentation" --section="0"\
48                 --release="LilyPond $(MAJVER).$(MINVER).$(PATCHLEVEL)" $< > $@
49 #
50
51 # outdirs:
52 #
53 # ?$(outdir)/%.dep:
54 %.dep:
55         touch $@
56 $(outdir):
57         mkdir $(outdir)
58         @touch $(genout)
59 %/$(outdir):y
60         mkdir $@
61         @touch $(@D)/$(genout)
62 $(genout):
63         mkdir $(outdir)
64         @touch $@
65 %/$(genout):
66         mkdir $(@D)/$(outdir)
67         @touch $@
68 #
69
70 # build and config stuff: (could make this generic default rule...)
71 #
72 %/.build:
73         @echo 0 >$@
74 $(flower-config): $(flower-dir)/$(genout)
75         touch $@
76 $(lily-config): $(lib-dir)/$(genout)
77         @echo "#define LIBDIR \"./\"" >$@
78 %.hh:
79         touch $@
80 #
81
82 # specific stuff:
83 #
84 $(LIBFLOWER): check-flower-version
85         $(MAKE) ./$(outdir)/$(@F) -C $(depth)/flower/lib
86 #
87 $(LIBLILY): dummy
88         $(MAKE) ./$(outdir)/$(@F) -C $(depth)/lib
89 #
90