GNU portable equivalent makes up% pattern rules

I follow the directions Using verification with the Autotools page in an attempt to build unit test support in a (currently) small C project. Although I use Cgreen instead of Check .

I am having trouble with step 9, which causes automake to issue a warning about using the `% 'pattern rules - a GNU make extension.

Private rule make:

check_%.$(OBJEXT) : $(srcdir)/%.c
    $(COMPILE) -DCHECKING -c -o $@ $^

I am wondering if there is an equivalent way of specifying this rule that does not rely on gnu make extensions.

+5
source share
2 answers

, .

.c.o:
        $(COMPILE) -DCHECKING -c -o $@ $<

. ( Automake, , .) , check_showdns.o showdns_check.o:

SUFFIXES = _check.o 
check_libapdns_LDADD        = @CHECK_LIBS@ showdns_check.o
.c_check.o:
        $(COMPILE) -DCHECKING -c -o $@ $<
+7

. GNU make Unix- ; makefile. GNU make .

-2

All Articles