[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Need help with GNU make: "No rule to make target"
From: |
Jay Lawrence |
Subject: |
RE: Need help with GNU make: "No rule to make target" |
Date: |
Thu, 10 Oct 2013 13:44:15 -0400 |
Two thoughts Jeremy, First you have an extra parenthesis '($(OBJS))', the
outer parens aren't necessary and I don't know what they will do.
# With substitution
tst_%: tst_%.c $(INCS) $(LIBVUTL) ($(OBJS)) $(LIBVLIB)
$(CC) $(CFLAGS) $< $(LDOPTS) -o $@
Secondly, when I build pattern rules, I separate the dependencies from the
recipe. I would write this as (with the extra () removed):
# With substitution
tst_%: $(INCS) $(LIBVUTL) $(OBJS) $(LIBVLIB)
tst_%: tst_%.c
$(CC) $(CFLAGS) $< $(LDOPTS) -o $@
Hope it helps ...
Jay
-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of Burri,
Jeremy
Sent: Thursday, October 10, 2013 1:29 PM
To: Jed Brown; address@hidden
Subject: RE: Need help with GNU make: "No rule to make target"
Actually attaching the attachment would help.
-----Original Message-----
From: Burri, Jeremy
Sent: Thursday, October 10, 2013 10:28 AM
To: 'Jed Brown'; address@hidden
Subject: RE: Need help with GNU make: "No rule to make target"
Hi Jeb,
Sorry for the delayed response. I do my development on a closed system (no
network access), so I have to print out the material and retype it. Here is
the stripped down version of the Makefile which still exhibits the issue:
ROOTDIR = ../../..
VLIBDIR = $(ROOTDIR)/libs/vlib
LIBVLIB = $(VLIBDIR)/lib/libvec.a
LIBVUTL = $(VLIBDIR)/tst/libutl.a
MYLDOPTS = -lmkl_intel_lp64 -lmkl_core -lmkl_sequential -lpthread
-lrt
USE_INTEL = /usr/local/etc/use_ictce4
INTEL_VERS = 64 20100414Z
ICCFLGS = -O3 -ip -axPTW -D_GNU_SOURCE -D H5_USE_16_API
MKL_PATH := $(shell $(USE_INTEL) mkl_library_path
$(INTEL_VERS))
export PATH := $(shell $(USE_INTEL) path $(INTEL_VERS))
export LD_PATH := $(shell $(USE_INTEL) ld_library_path
$(INTEL_VERS))
VECINC = $(VLIBDIR)/include
MKLINC = /opt/intel/ictce/4.0.0.020/mkl/include
INCS = vparm.h $(VECINC)/vlib.h
OBJS = prttime.o fftunpk.o
CONLY = -c
CFLAGS = -I$(VECINC) -I$(MKLINC) $(ICCFLGS)
LDFLAGS = -L$(MKL_PATH)
LDOPTS = $(LIBVUTL) $(LIBVLIB) $(LDFLAGS) $(MYLDOPTS)
AR = ar
ARFLAGS = rcv
CC = icc
TSTS = tst_rvfft2d
all: $(LIBVUTL) $(TSTS)
$(LIBVUTL): $(OBJS)
$(AR) $(ARFLAGS) $(LIBVUTL) $?
# With substitution
tst_%: tst_%.c $(INCS) $(LIBVUTL)($OBJS)) $(LIBVLIB)
$(CC) $(CFLAGS) $< $(LDOPTS) -o $@
# Without substitution
#tst_rvfft2d: tst_rvfft2d.c $(INCS) $(LIBVUTL)($OBJS)) $(LIBVLIB)
# $(CC) $(CFLAGS) $< $(LDOPTS) -o $@
$(LIBVLIB): FORCE
cd ..; $(MAKE)
clean:
rm -f *.o
rm -f $(TSTS)
rm -f $(LIBVUTL)
FORCE:
run: runtst
runtst:
for tst in $(TSTS); do ./$$tst; done
Here is the output when running make:
address@hidden tst]$ make -f Makefile_tst clean all
rm -f *.o
rm -f tst_rvfft2d
rm -f ../../../libs/vlib/tst/libutl.a
icc -I../../../libs/vlib/include
-I/opt/intel/ictce/4.0.0.020/mkl/include -O3 -ip -axPTW -D_GNU_SOURCE -D
H5_USE_16_API -c -o prttime.o prttime.c
icc -I../../../libs/vlib/include
-I/opt/intel/ictce/4.0.0.020/mkl/include -O3 -ip -axPTW -D_GNU_SOURCE -D
H5_USE_16_API -c -o fftunpk.o fftunpk.c
ar rcv ../../../libs/vlib/tst/libutl.a prttime.o fftunpk.o
a - prttime.o
a - fftunpk.o
make: *** No rule to make target 'tst_rvfft2d', needed by 'all'.
Stop.
Since I have to retype the material, I was worried about making a typo so I
included the print out with the original material in it. You will see a
copy of the above Makefile and output. You will also find the output when
substitution is not used. Remember, the above Makefile works in RHEL4 with
make 3.80, but does not work with RHEL5 with make 3.81.
As a test, I created a simple Makefile with substitution and of course it
works fine. You can see the Makefile and output in the same attached file.
This would lead me to believe that there is an issue with my Makefile (no
big surprise), but the issue is manifesting itself is a way that I don't
understand. It does not seem to be an issue with the actual pattern
substitution, but if this is true then why is it manifesting itself as a
pattern substitution error?
-Jeremy
-----Original Message-----
From: Jed Brown [mailto:address@hidden On Behalf Of Jed Brown
Sent: Tuesday, October 08, 2013 5:48 PM
To: Burri, Jeremy; address@hidden
Subject: RE: Need help with GNU make: "No rule to make target"
"Burri, Jeremy" <address@hidden> writes:
> When I run "make all" I get the following under RHEL5 with make v3.81:
>
> Make: *** No rule to make target 'tst_rvfft2d', needed by 'all'.
Stop.
Huh, I can't reproduce. Is the above your complete makefile and do you have
anything in MAKEFLAGS?
- Need help with GNU make: "No rule to make target", Burri, Jeremy, 2013/10/08
- Re: Need help with GNU make: "No rule to make target", Jed Brown, 2013/10/08
- RE: Need help with GNU make: "No rule to make target", Burri, Jeremy, 2013/10/08
- RE: Need help with GNU make: "No rule to make target", Jed Brown, 2013/10/08
- RE: Need help with GNU make: "No rule to make target", Burri, Jeremy, 2013/10/09
- RE: Need help with GNU make: "No rule to make target", Burri, Jeremy, 2013/10/10
- RE: Need help with GNU make: "No rule to make target", Burri, Jeremy, 2013/10/10
- RE: Need help with GNU make: "No rule to make target",
Jay Lawrence <=
- Re: Need help with GNU make: "No rule to make target", Philip Guenther, 2013/10/10
- Re: Need help with GNU make: "No rule to make target", Paul Smith, 2013/10/10
- RE: Need help with GNU make: "No rule to make target", Jay Lawrence, 2013/10/10
- RE: Need help with GNU make: "No rule to make target", Burri, Jeremy, 2013/10/10
- RE: Need help with GNU make: "No rule to make target", Burri, Jeremy, 2013/10/14
- Re: Need help with GNU make: "No rule to make target", Paul Smith, 2013/10/14