Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -495,12 +495,12 @@ fi # portlogger-example : portlogger-example.scm api.o archive.o common.o configf.o dashboard-tests.o dashboard-context-menu.o db.o dcommon.o ezsteps.o genexample.o gutils.o items.o keys.o launch.o lock-queue.o margs.o mt.o ods.o portlogger.o process.o rmt.o runconfig.o runs.o server.o synchash.o tasks.o tdb.o tests.o tree.o # csc $(CSCOPTS) portlogger-example.scm api.o archive.o common.o configf.o dashboard-tests.o dashboard-context-menu.o db.o dcommon.o ezsteps.o genexample.o gutils.o items.o keys.o launch.o lock-queue.o margs.o mt.o ods.o portlogger.o process.o rmt.o runconfig.o runs.o server.o sync-hash.o tasks.o tdb.o tests.o tree.o -unitdeps.dot : *scm ./utils/plot-uses - ./utils/plot-uses todot *.scm > unitdeps.dot +unitdeps.dot : *scm ./utils/plot-uses Makefile + ./utils/plot-uses todot commonmod.import,mtargs.import,mtargs,debugprint *.scm > unitdeps.dot unitdeps.pdf : unitdeps.dot dot unitdeps.dot -Tpdf -o unitdeps.pdf ./utils/plot-uses : utils/plot-uses.scm Index: utils/plot-uses.scm ================================================================== --- utils/plot-uses.scm +++ utils/plot-uses.scm @@ -38,11 +38,11 @@ (define (print-err . data) (with-output-to-port (current-error-port) (lambda () (apply print data)))) -(define (process-file fname) +(define (process-file ignores fname) (with-input-from-file fname (lambda () (let loop ((modname "DUMMYMOD")) (let* ((inl (read-line))) (if (eof-object? inl) @@ -51,30 +51,34 @@ ((_ dtype unitname) (if (equal? dtype "unit") (loop unitname) (begin (if (equal? dtype "uses") - (if (not (member modname '("DUMMYMOD"))) + (if (not (or (member modname '("DUMMYMOD")) + (member modname ignores) + (member unitname ignores))) (print " \""unitname"\" -> \""modname"\";")) (print-err "ERROR: bad declare line \""inl"\"")) (loop modname)))) (else (loop modname))))))))) (define (main) (match (command-line-arguments) - (("todot" . files) - (print-err "Making graph for files: " (string-intersperse files ", ")) - (print "digraph uses_unit {") - (for-each - (lambda (fname) - (print "// Filename: "fname) - (process-file fname)) - files) - (print "}")) + (("todot" ignoreunits . files) + (let* ((ignores (string-split ignoreunits ","))) + (print-err "Making graph for files: " (string-intersperse files ", ")) + (print "digraph uses_unit {") + (for-each + (lambda (fname) + (print "// Filename: "fname) + (process-file ignores fname)) + files) + (print "}"))) (else - (print-err "Usage: plot-uses file1.scm ...")))) + (print-err "Usage: plot-uses u1,u2... file1.scm ...") + (print-err " where u1,u2... are units to ignore and file1.scm... are the files to process.")))) (main) ) ;;