Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 May 2005 08:56:36 -0600
From:      Jon Drews <jon.drews@gmail.com>
To:        freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Suffix rules in Makefile
Message-ID:  <8cb27cbf050502075671aa177b@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
5.4-STABLE #0: Sun Apr 24 08:30:32 MDT 2005


Hi:

  I am having trouble with a .SUFFIXES based Makefile. If I use this
Makefile containing .out:

INCLUDES=3D -Wall -I/usr/local/include
LINK=3D -L/usr/local/lib
LIBS=3D -lgsl -lgslcblas -lm
.SUFFIXES : .c .o .out

.o.out:
        ${CC} ${LINK} -o $@ $< ${LIBS}

.c.o:
        ${CC} ${INCLUDES} -c $<

$ make complexPow.out
cc -O2 -pipe -march=3Dpentiumpro  complexPow.c  -o complexPow.out
complexPow.c:4:29: gsl/gsl_complex.h: No such file or directory
                         <snip>
it's not finding it's includes.

However if I change the .out extension to .OUT it works:

INCLUDES=3D -Wall -I/usr/local/include
LINK=3D -L/usr/local/lib
LIBS=3D -lgsl -lgslcblas -lm
.SUFFIXES : .c .o .OUT

.o.OUT:
        ${CC} ${LINK} -o $@ $< ${LIBS}

.c.o:
        ${CC} ${INCLUDES} -c $<

$ make complexPow.OUT
cc -Wall -I/usr/local/include -c complexPow.c
cc -L/usr/local/lib -o complexPow.OUT complexPow.o -lgsl -lgslcblas -lm

  Why does the .SUFFIXES definition for .out, in the first Makefile
not work? I looked in /usr/share/mk/sys.mk and did not see a
definition for .o.out either.
--=20
Kind regards,
Jonathan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8cb27cbf050502075671aa177b>