%% Bill Moseley <[EMAIL PROTECTED]> writes:

  bm> I use this style on Linux and Solaris machines.
  bm> target = file.out

  bm> all: $(target)

  bm> %.out: %.in
  bm>         @echo "creating $@ from $<"

  bm> But on FreeBSD 4.8-RC I get:

  bm> make: don't know how to make file.out. Stop

  bm> Is there a more portable way to write that?

Pattern rules are not truly portable: they are not defined in the POSIX
standard for example.

If you want a makefile that's portable between many variants of make you
need to use suffix rules:

  .SUFFIXES: .in .out
  .in.out:
        @echo "creating $@ from $<"


Of course, a better way to go is to just require the use of GNU make:
requiring a portable make is infinitely simpler than writing portable
makefiles.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[EMAIL PROTECTED]>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist


_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make

Reply via email to