lcn2 / calc

C-style arbitrary precision calculator
http://www.isthe.com/chongo/tech/comp/calc/index.html
Other
346 stars 52 forks source link

Allow Makefile customizations in one place #11

Closed assistcontrol closed 3 years ago

assistcontrol commented 4 years ago

Because specifying settings requires patching Makefile.ship extensively, updating calc is non-trivial for maintainers of package spec files (I maintain FreeBSD's port).

If Makefile.ship could be trained to source a file (such as Makefile.local) to overwrite defaults, it'd allow definitions in one place and make maintaining calc much simpler.

Is this something you'd be interested in?

lcn2 commented 3 years ago

Yes, assistcontrol, we would be interested in such a change.

lcn2 commented 3 years ago

We have added the following lines just before the first rule on the Makefile:

#if 0   /* start of skip for non-Gnu makefiles */
include Makefile.local
#endif  /* end of skip for non-Gnu makefiles */

The Makefile.local file, as shipped, just as a single comment:

# Add below to override Makefile values (using :=) as in: HAVE_STRING_H:= YES

This will allow you to override any Makefile variable, such as:

    HAVE_STRING_H:= YES
    HAVE_TIMES_H:= YES
    SED:= /usr/local/bin/nsed

Thus you can put all of your local variable mods for given package into the Makefile.local file.

This has been added to the top of the master branch and will be included in the next release ls calc.

Thank you for your suggestion @assistcontrol and sorry for how long it too for use to implement your idea.