Is there a utility for checking makefiles?

I would like to check my handwritten files to make sure that they work as intended on different platforms. Is there any usefulness that I can use to warn me about features that may interfere?

+6
source share
2 answers

I don’t know how much I know.

The best thing to do is respect the old rule "port before, port often." Try to create the application on other platforms as soon as possible and repeat it when you have the opportunity. This will throw out portability errors in your code and check the Makefile as a side effect.

However, it is wise to limit yourself to the conservative functions of the Makefile as much as possible. You might want to see POSIX do the manpage (although I would advise you to use the %.foo: %.bar and the nominally standard .bar.foo: rules), and portable make programming in the autoconf manual contains good advice.

Oh, and you know autoconf is a good thing, right?

+1
source

sorry, but .... not sure if any code can use eveywhere code, this is one of the strongest and weakest points of Unix .... there are so many different tastes of the OS itself and the implementation of Make Utility - GNU is only one of them, as well as an open form of diesel fuel (small differences), but they share many common functions.

there are GNU Make functions that are only available if you invoke your makefile with GNU make, the same for the other OS variables of the make .. utility, with restrictions such as these

"rigorous testing on all the possible systems you want it to work is the only solution that comes to my mind"

0
source

Source: https://habr.com/ru/post/908390/


All Articles