Skip to content

Commit

Permalink
Rewrote acprep in Python and improved the build
Browse files Browse the repository at this point in the history
  • Loading branch information
jwiegley committed Mar 10, 2009
1 parent 6154b9e commit e0473e2
Show file tree
Hide file tree
Showing 10 changed files with 1,311 additions and 621 deletions.
67 changes: 23 additions & 44 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ VERSION = 3.0
ACLOCAL_AMFLAGS = -I m4
dist_man_MANS = doc/ledger.1
SUBDIRS = po intl
EXTRA_DIST = autogen.sh config.rpath contrib
EXTRA_DIST = autogen.sh config.rpath contrib src/system.hh.in
DISTCLEANFILES = .timestamp

lib_LTLIBRARIES = \
libledger_report.la \
Expand Down Expand Up @@ -81,7 +82,7 @@ libledger_report_la_LDFLAGS = -release $(VERSION).0

pkginclude_HEADERS = \
$(top_builddir)/config.h \
src/system.hh \
$(top_builddir)/system.hh \
src/utils.h \
src/flags.h \
src/hooks.h \
Expand Down Expand Up @@ -144,18 +145,24 @@ pkginclude_HEADERS = \
lib/utfcpp/source/utf8/core.h \
lib/utfcpp/source/utf8/unchecked.h

CLEANFILES =
nodist_libledger_util_la_SOURCES = $(top_builddir)/system.hh

BUILT_SOURCES = $(top_builddir)/system.hh
CLEANFILES = system.hh

system.hh: src/system.hh.in
cp -p $< $@

if USE_PCH
nodist_libledger_util_la_SOURCES = src/system.hh.gch
nodist_libledger_util_la_SOURCES += $(top_builddir)/system.hh.gch

BUILT_SOURCES = src/system.hh.gch
CLEANFILES += $(srcdir)/src/system.hh.gch
BUILT_SOURCES += $(top_builddir)/system.hh.gch
CLEANFILES += system.hh.gch

$(srcdir)/src/system.hh.gch: $(srcdir)/src/system.hh $(top_builddir)/config.h
system.hh.gch: $(top_builddir)/system.hh
$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(lib_cppflags) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) \
-g -o $@ $(srcdir)/src/system.hh
-o $@ $(top_builddir)/system.hh
endif

######################################################################
Expand All @@ -174,7 +181,7 @@ info_TEXINFOS = doc/ledger.texi

dist_lisp_LISP = lisp/ledger.el lisp/timeclock.el
ELCFILES =
DISTCLEANFILES = ledger.elc timeclock.elc
DISTCLEANFILES += ledger.elc timeclock.elc

all_sources = $(libledger_util_la_SOURCES) \
$(libledger_math_la_SOURCES) \
Expand Down Expand Up @@ -320,11 +327,10 @@ all_py_tests_sources = \
$(patsubst test/unit/%.cc,$(top_builddir)/test/python/%.py, \
$(filter test/unit/t_%.cc,$(all_tests_sources)))

$(top_builddir)/test/python/%.py: $(srcdir)/test/unit/%.cc \
$(srcdir)/test/convert.py
test/python/%.py: test/unit/%.cc test/convert.py
$(PYTHON) $(srcdir)/test/convert.py $< $@

$(top_builddir)/test/python/UnitTests.py: $(all_py_tests_sources)
test/python/UnitTests.py: $(all_py_tests_sources)
@echo "from unittest import TextTestRunner, TestSuite" > $@
@for file in $$(ls $(srcdir)/test/unit/*.cc); do \
base=$$(basename $$file); \
Expand Down Expand Up @@ -461,12 +467,11 @@ distclean-local: distclean-local-doxygen
if USE_DOXYGEN
ESC_top_builddir=`cd $(top_builddir); pwd | sed 's/\//\\\\\//g'`

$(top_builddir)/Doxyfile.gen: $(srcdir)/doc/Doxyfile
cat $(srcdir)/doc/Doxyfile \
| sed "s/%srcdir%/$(ESC_srcdir)/g" \
| sed "s/%builddir%/$(ESC_top_builddir)/g" > $@
Doxyfile.gen: doc/Doxyfile
cat $< | sed "s/%srcdir%/$(ESC_srcdir)/g" \
| sed "s/%builddir%/$(ESC_top_builddir)/g" > $@

$(top_builddir)/doc/html/index.html: $(top_builddir)/Doxyfile.gen $(all_files)
doc/html/index.html: $(top_builddir)/Doxyfile.gen $(all_files)
BUILD_DIR=`cd $(top_builddir); pwd`; \
(cd $(srcdir); doxygen $$BUILD_DIR/Doxyfile.gen)

Expand All @@ -475,7 +480,7 @@ $(top_builddir)/doc/html/index.html: $(top_builddir)/Doxyfile.gen $(all_files)
# run, since it's quite possible that the user will not have a complete
# TeX + Doxygen + dot environment on their own system.

$(top_builddir)/doc/refman.pdf: $(top_builddir)/doc/html/index.html
doc/refman.pdf: $(top_builddir)/doc/html/index.html
(cd $(top_builddir)/doc/latex && make)
cp $(top_builddir)/doc/latex/refman.pdf $@

Expand Down Expand Up @@ -503,30 +508,4 @@ report: all
genhtml -o doc/report doc/report/ledger_cov.info
@echo Coverage reported generated\; now open doc/report/index.html

sloc:
sloccount $(srcdir)/src $(srcdir)/python $(srcdir)/lisp $(srcdir)/test

######################################################################

STAGING = /tmp/ledger

copy-sources:
-mkdir -p $(STAGING)
rsync -av --delete --exclude=/.libs/ --exclude=/.deps/ \
--exclude=/plan/ --exclude=/2.6*/ --exclude=/archive/ \
$(srcdir)/ $(STAGING)/
-(cd $(STAGING); git clean -x -d -f)

release: copy-sources
(cd $(STAGING); \
nice -n 20 ./acprep --release --opt --build -j3)

release-distcheck: copy-sources
(cd $(STAGING); \
nice -n 20 ./acprep --release --build -j3 distcheck)

benchmark: release
PATH=$(PATH):$(srcdir)/tools \
$(srcdir)/tools/speedcmp 50 $(STAGING)/ledger

# Makefile.am ends here
17 changes: 9 additions & 8 deletions README.textile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ major bugs that you find. Just e-mail me, or post to the mailing list,
they'll become a part of my work list.

| *CURRENT* | @git checkout master@ |
| *BETA* | @git checkout -b v2.6.2b origin/v2.6.2b@ |
| *BETA* | @git checkout -b maint origin/maint@ |
| *RELEASE* | @git checkout v2.6.1@ |

There are also several topic branches which contain experimental features,
Expand All @@ -60,7 +60,7 @@ h3. For building the current master branch
| doxygen | 1.5.7.1 | _optional_, for @make docs@ |
| graphviz | 2.20.3 | _optional_, for @make docs@ |
| texinfo | 4.13 | _optional_, for @make docs@ |
| lcov | 1.6 | _optional_, for @make report@, used with @./acprep --gcov@|
| lcov | 1.6 | _optional_, for @make report@, used with @./acprep gcov@|
| sloccount | 2.26 | _optional_, for @make sloc@ |

h3. For building the beta or release branches
Expand Down Expand Up @@ -107,19 +107,20 @@ The next step is preparing your environment for building. While you can use
you:

<pre>
tools/myacprep
./acprep
</pre>

Please read the contents of @config.log@ if the configure step fails.
Please read the contents of @config.log@ if the configure step fails. Also,
see the @help@ command to @acprep@, which explains some of its many options.
It's pretty much the only command I run for configuring, building and testing
Ledger.

h2. Building

Once you have the dependencies installed and the source prepared for building,
run @make@. If you have CppUnit installed, I prefer you always run
@make fullcheck@, as this will verify Ledger against the unit tests, the
Python unit tests (if applicable), and the regression tests.
run @make check@ to get things started and confirm the result.

If you have extra CPU cycles to burn, try @tools/proof@, which provides the
If you have extra CPU cycles to burn, try @./acprep proof@, which provides the
most thorough shakedown of a healthy source tree.

h2. Resources
Expand Down
Loading

0 comments on commit e0473e2

Please sign in to comment.