I'm following the directions on the Using Check with the Autotools page in an attempt to build in support for unit test in a (currently) small C project. Although I am using Cgreen instead of Check.
I'm having trouble with step 9, which is causing automake to emit a warning about the use of `%'-style pattern rules being a GNU make extension.
The particular make rule is:
check_%.$(OBJEXT) : $(srcdir)/%.c
$(COMPILE) -DCHECKING -c -o $@ $^
I'm wondering if there is an equivalent way of specifying this rule that does not rely on gnu make extensions.
Portable make rules can only use different suffixes, the prefixes should be the same.
.c.o:
$(COMPILE) -DCHECKING -c -o $@ $<
The suffix does not necessarily starts with a dot, however. (In that case you have to tell Automake what your suffixes are, because it cannot guess.) So for instance you could have something as follows if you rename check_showdns.o
to showdns_check.o
:
SUFFIXES = _check.o
check_libapdns_LDADD = @CHECK_LIBS@ showdns_check.o
.c_check.o:
$(COMPILE) -DCHECKING -c -o $@ $<
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With