=================== Build Systems =================== :Author: Martin Blais :Date: 2006-05-14 :Abstract: Notes related to build systems, make, Jam, etc. .. contents:: .. 1 Porting xxdiff to qmake 1.1 TODO 1.2 Done 1.3 Links 1.4 Lex/Yacc Porting xxdiff to qmake ======================= We're porting xxdiff to qmake 4.1. Some notes of that process. TODO ---- * Automatically generating the version.h file from the xxdiff/VERSION file:: echo "#define XX_VERSION \"`cat ../VERSION`\"" > version.h * Automatically generating the documentation input file with a sed command needs to be done automatically although this only needs be done once and ``doc.h`` could be saved if this is too difficult:: sed -e 's/\"/\\\"/g;s/$/\\n\\/;1s/^/char text[]=\"/;$s/\\$/\"\;/' doc.html > doc.h * Converting the source txt document to produce the html document can be done via another makefile, or if we can inject the following rule:: .txt.html: rst2html.py --output-encoding=iso-8859-1 $< $@ We could remove this dependencny and place it in a simple makefile, because only the author and people who would want modify the docs need to use it, and the output file is always provided in the distribution. We certainly don't want to introduce a dependency on docutils. * We need to remove resParser_lex.o and resParser_yacc.o from the build, we don't actually need to build them. An alternative would be to remove them as includes to resParser.cpp and include their .h and use them the normal way. Done ---- * We will need to change the source files somewhat, due to the following changes imposed by qmake:: bison -d -o resParser.y.c resParser.y becomes:: bison -d -o y.tab.c -p resParser -b resParser resParser.y Relatively easily done. Renamed symbols in resParser.cpp. * We may need to add an automatic dependency from cmdline.o to the yacc output files:: cmdline.o: $(YACCOUTH) cmdline.obj: $(YACCOUTH) This was taken care of automatically by qmake. * We need to add a dependency from resParser.o which includes the .y.h, .y.c and .l.c files:: $(LEXOUT): $(LEXIN) $(LEX) $(LEXDEBUG) -o$(LEXOUT) $(LEXIN) $(YACCOUTC) $(YACCOUTH): $(YACCIN) $(LEXOUT) $(YACC) $(YACCDEBUG) -o$(YACCOUTC) $(YACCIN) $(PARSOBJ): $(YACCOUTC) $(YACCOUTH) $(LEXOUT) This was taken care of automatically by qmake. * clean: Add a rule for removing the lex/yacc output files (.l.c, .y.h, .y.c) Easy: this is taken care of by the LEXSOURCES and YACCSOURCES. * clean: Removing doc.h version.h Easy: we just added those to QMAKE_CLEAN. * Customize the lex/yacc files for resParser:: flex -oresParser.l.c resParser.l bison -d -oresParser.y.c resParser.y Easy: we use the following rules from `Undocumented Qmake`_ QMAKE_LEX = flex QMAKE_YACC = bison solaris-cc { QMAKE_YACCFLAGS_MANGLE = -o y.tab.c -p $base } linux-g++ { QMAKE_YACCFLAGS = -d -o y.tab.c QMAKE_YACC_HEADER = QMAKE_YACC_SOURCE = } .. _`Undocumented Qmake`: http://paulf.free.fr/undocumented_qmake.html