Makefile: Gather statistics and report them.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 18 Nov 2009 13:32:22 +0000 (13:32 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 18 Nov 2009 13:32:22 +0000 (13:32 +0000)
For now, just the lengths of the source files.  Maybe we can think of
more interesting things to measure later.

Makefile

index 86e5616..82f588e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -13,6 +13,7 @@
 
 .SUFFIXES: .o
 LANGS                   =
+SOURCES                         =
 TARGETS                         = $(patsubst %,%-fringe,$(LANGS))
 CLEANFILES              = $(TARGETS)
 
@@ -46,6 +47,12 @@ test:: all
        fi
 
 ###--------------------------------------------------------------------------
+### Reporting.
+
+report::
+       wc -l $(SOURCES) | sort -n
+
+###--------------------------------------------------------------------------
 ### C.
 
 CC                      = gcc
@@ -55,6 +62,7 @@ CLEANFILES            += *.o
 .c.o:; $(CC) -c $(CFLAGS) -o $@ $<
 
 LANGS                  += c
+SOURCES                        += c-fringe.c
 c-fringe: c-fringe.o
        $(CC) -o $@ $^
 
@@ -68,6 +76,7 @@ CLEANFILES            += *.hi *.hc
 .hs.o:; $(HC) -c $(HFLAGS) -o $@ $<
 
 LANGS                  += haskell
+SOURCES                        += haskell-fringe.hs
 haskell-fringe: haskell-fringe.o
        $(HC) -o $@ $^
 
@@ -78,6 +87,7 @@ ICONT                  = icont
 IFLAGS                  = -u -fa
 
 LANGS                  += icon
+SOURCES                        += icon-fringe.icn
 icon-fringe: icon-fringe.icn
        $(ICONT) -o $@ $^
 
@@ -87,6 +97,7 @@ icon-fringe: icon-fringe.icn
 CLEANFILES             += *.core
 
 LANGS                  += cl
+SOURCES                        += cl-fringe.lisp
 cl-fringe: cl-fringe.lisp
 ##     cl-launch -R -o $@ -f `pwd`/$^  -- slow to start
        cl-launch -o $@ -f `pwd`/$^ +I -r launch -d $@.core
@@ -100,6 +111,7 @@ CLEANFILES          += *.exe
 .fs.exe:; fsc -o $@ $<
 
 LANGS                  += f\#
+SOURCES                        += f\#-fringe.fs
 f\#-fringe: f\#-fringe.exe
        chmod +x $<
        cp $< $@
@@ -113,6 +125,7 @@ SCMFLAGS             = -c -O2
 .scm.o:; $(SCMC) $(SCMFLAGS) -o $@ $<
 
 LANGS                  += scheme
+SOURCES                        += scheme-fringe.scm
 scheme-fringe: scheme-fringe.o
        $(SCMC) -o $@ $^
 
@@ -121,6 +134,7 @@ scheme-fringe: scheme-fringe.o
 
 LANGS                  += smalltalk
 TARGETS                        += smalltalk-fringe.im
+SOURCES                        += smalltalk-fringe.st
 smalltalk-fringe.im: smalltalk-fringe.st
        echo "ObjectMemory snapshot: '$@.new'" | gst $^ -
        mv $@.new $@