[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 'Generic' pattern rules

From: marc
Subject: Re: 'Generic' pattern rules
Date: Thu, 25 Aug 2011 16:07:08 +0200
User-agent: Roundcube Webmail/0.5.1

Sure. Here is a subset of the actual Makefile:


OPENSSL = openssl
KEYSIZE = 2048
SUBJECT = /CN=foobar


        $(OPENSSL) genrsa -out $@ $(KEYSIZE)

%.req: %.key
        $(OPENSSL) req -out $@ -key $< -subj $(SUBJECT) -new -batch

carbon.req: carbon.key

hydrogen.req: SUBJECT = /
hydrogen.req: myrsa2048.key


When 'make carbon.req' is executed, 'carbon.key' is first created if not already present (first pattern rule), and then 'carbon.req'

However, when 'make hydrogen.req' is executed, 'myrsa2048.key' is not taken into account since the pattern rule is meant to match 'hydrogen.req: hydrogen.key'.

The only solution I found so far is to use canned recipes instead of pattern rules. But that's not that elegant...

There is probably a complicated way to most (but not all) of what
you're trying to do. Can you give a more detailed example that's
closer to your actual use case?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]