> We need to update ht.db in case when some of pages (.ht files)
> change.

Clear. But if I rerun 'make' where ht.db is newer than any of the .ht 
files, then there is no need to start the rebuilding process. No?

 > Unfortunatly, normal make logic does not work very
> well here because ht.db is needed to produce .pht files, but
> we need to add information from .pht files to final ht.db.

Then I'd say that we add something like that (untested and certainly not 
yet working)

all: pht.db.stamp

ht.db.stamp: $(ALL_HTFILES)
        # add the .ht
        cd $(THTDIR); rm -f ht.db ; ${HTADD} *.ht
        touch $@

pht.db.stamp: ht.db.stamp
        if [ -f copy_nphts ] ; then \
           ${MAKE} copy-nphts ; \
        else \
           $(MAKE) nphts ; \
        fi
        if [ -f copy_gphts ] ; then ${MAKE} copy-gphts ; fi
        cd $(THTDIR); rm -f ht.db ; ${HTADD} *.ht *.pht
        touch $@

This should avoid building ht.db twice.
I just haven't yet investigated how to get such a variable ALL_HTFILES, 
since you just access them currently via *.ht (which is somehow not 
perfect). Where are the .ht files generated?

Maybe it would be easy to leave a stamp after all the .ht files are 
generated and in that this makefile we just give htfiles.stamp as a 
dependency instead of $(ALL_HTFILES).

> I must say that I did not really try to remove redundancy
> here -- htadd seem to be fast enough so that it does not
> matter if we run it more times than strictly necessary.

OK, I could also live with that. But I don't like to see all the
'add blah.ht' lines. That is what initially disturbed me.

> I did have problems because htadd adds things to ht.db,
> but apparently does not remove older versions.  I think
> that the best way to solve such problems is to consistenly
> remove old ht.db and produce fresh one.

OK, but don't generate an up-to-date ht.db twice.

Ralf

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to