summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile80
1 files changed, 22 insertions, 58 deletions
diff --git a/Makefile b/Makefile
index 2d8fa8a3ca..8f05ad90f8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,55 +1,13 @@
-MAJVER=0
-MINVER=0
-PATCHLEVEL=8
-
-TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
-
-#
-#
-
-include Sources.make
-progdocs=$(hdr) $(mycc)
-gencc=parser.cc lexer.cc
-cc=$(mycc) $(gencc)
-obs=$(cc:.cc=.o)
-
-
-#dist
-.EXPORT_ALL_VARIABLES:
-
-DOCDIR=docdir
-VERSION=$(MAJVER).$(MINVER).$(PATCHLEVEL)
-PACKAGENAME=lilypond
-DNAME=$(PACKAGENAME)-$(VERSION)
-othersrc=lexer.l parser.y
-SCRIPTS=make_version make_patch genheader
-IFILES=dimen.tex symbol.ini suzan.ly maartje.ly\
- lilyponddefs.tex test.tex .dstreamrc
-OFILES=Makefile Sources.make COPYING README
-DFILES=$(hdr) $(mycc) $(othersrc) $(OFILES) $(IFILES) $(SCRIPTS)
-
-#compiling
-LOADLIBES=-L$(FLOWERDIR) -lflower
-FLOWERDIR=../flower
-# speedy
-#DEFINES=-DNDEBUG -DNPRINT -O2
-# lots of debugging info
-DEFINES=-g
-
-CXXFLAGS=$(DEFINES) -I$(FLOWERDIR) -pipe -Wall -W -pedantic
-FLEX=flex
-BISON=bison
-exe=$(PACKAGENAME)
-
-##################################################################
+include Make.variables
$(exe): $(obs)
- $(CXX) -o $@ $(obs) $(LOADLIBES)
+ $(CXX) -o $@ $^ $(LOADLIBES)
+
clean:
rm -f $(exe) *.o $(DOCDIR)/* core
distclean: clean
- rm -f TAGS depend version.hh $(gencc) .GENERATE *~
+ rm -f depend version.hh $(gencc) .GENERATE *~
all: kompijl doc
@@ -58,8 +16,13 @@ doc:
-mkdir $(DOCDIR)
doc++ -p -I -d $(DOCDIR) $(progdocs)
-depend: Sources.make .GENERATE
- $(CXX) $(CXXFLAGS) -MM $(cc) > $@
+depend: Sources.make .GENERATE
+ touch depend
+ $(MAKE) realdepend
+
+
+$(OBJECTDIR)/%.o: $(CCDIR)/%.cc
+ $(CXX) -c $(CXXFLAGS) $(OUTPUT_OPTION)
# hack to create these sources once, before the dependencies
.GENERATE:
@@ -68,25 +31,26 @@ depend: Sources.make .GENERATE
$(MAKE) $(gencc)
rm -f depend
+realdepend: $(cc)
+ $(CXX) $(CXXFLAGS) -MM $^ | perl -ne 's/^(.+)\.o/'$(OBJECTDIR)'\/\1.o/; print;' > depend
+
include depend
-parser.cc: parser.y
+$(CCDIR)/parser.cc: parser.y
$(BISON) -d $<
- mv parser.tab.h parser.hh
- mv parser.tab.c parser.cc
+ mv $(CCDIR)/parser.tab.h $(HEADERDIR)/parser.hh
+ mv $(CCDIR)/parser.tab.c $(CCDIR)/parser.cc
parser.hh: parser.cc
version.o: $(obs) version.hh
version.hh: Makefile make_version
- make_version $(MAJVER) $(MINVER) $(PATCHLEVEL) > $@
+ make_version $(MAJVER) $(MINVER) $(PATCHLEVEL) > $(HEADERDIR)/$@
-lexer.cc: lexer.l
+src/lexer.cc: lexer.l
$(FLEX) -+ -t $< > $@
-DDIR=$(TOPDIR)/$(DNAME)
-SUBDIRS=Documentation
dist:
-mkdir $(DDIR)
ln $(DFILES) $(DDIR)/
@@ -98,7 +62,7 @@ dist:
rm -rf $(DDIR)/
-TAGS: $(mycc) $(hdr) Sources.make
- etags -CT $(mycc) $(hdr)
-
+TAGS:
+ $(MAKE) -C $(HEADERDIR) TAGS
+ $(MAKE) -C $(CCDIR) TAGS \ No newline at end of file