473,399 Members | 3,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

New to "make". Help, please!

While running make, I obtain the following error:

make: *** No rule to make target `amino_acid_param.h', needed by
`pdb2txt_relax.o'. Stop.

I'm confused, since header files (*.h) shouldn't need rules because
they're not compiled. What can I do?

Below is the makefile. Note that this makefile calls another makefile, and
it seems the error comes from this fact.

# file makefile_pdb2txt_relax
HOME = /users/seldon/jmborr
CODE = $(HOME)/Code
VPATH = $(CODE)/Heavy_atom_code:$(CODE)/PDBClasses

pdb2txt_relax.x: pdb2txt_relax.o amino_acid_param.o \
atom_param.o miscellanea.o \
bibliography.o pdbClasses2.o
g++ -o pdb2txt_relax.x pdb2txt_relax.o \
amino_acid_param.o atom_param.o \
miscellanea.o bibliography.o pdbClasses2.o

pdb2txt_relax.o: pdb2txt_relax.cpp amino_acid_param.h \
atom_param.h miscellanea.h random.h
g++ -Wno-deprecated -c pdb2txt_relax.cpp

include $(CODE)/Heavy_atom_code/makefile_Heavy_atom_code

PHONY : clean

clean :
rm -rf *.o core
#
Here below is the referred makefile

#file makefile_Heavy_atom_code
HOME = /users/seldon/jmborr
CODE = $(HOME)/Code
VPATH = $(CODE)/PDBClasses

amino_acid_param.o: amino_acid_param.cpp amino_acid_param.h miscellanea.h
g++ -Wno-deprecated -c amino_acid_param.cpp

atom_param.o: atom_param.cpp atom_param.h miscellanea.h bibliography.h
g++ -Wno-deprecated -c atom_param.cpp

miscellanea.o: miscellanea.cpp miscellanea.h bibliography.h pdbClasses2.h
g++ -Wno-deprecated -c miscellanea.cpp

bibliography.o: bibliography.cpp bibliography.h
g++ -Wno-deprecated -c bibliography.cpp

include $(CODE)/makefile_PDBClasses
Jul 22 '05 #1
6 2242
Note that this newsgroup is about the C++ programming language, and not
about any build tools, so you're clearly off-topic here.

jmborr wrote:
While running make, I obtain the following error:

make: *** No rule to make target `amino_acid_param.h', needed by
`pdb2txt_relax.o'. Stop.

I'm confused, since header files (*.h) shouldn't need rules because
they're not compiled. What can I do?


make doesn't know what a header file is. You just give it rules that
tell it which target files depend on which source files and how to
generate those targets from the sources. If a source file doesn't
exist, make in turn tries to find another rule that tells it how to
generate it from other sources.
You're specifying a file amino_acid_param.h as source in some rules, but
that file doesn't seem to exist, so make tries to find a rule to build
that file, which you didn't provide.

Jul 22 '05 #2
"jmborr" <jm****@bu.edu> wrote...
While running make, I obtain the following error:

make: *** No rule to make target `amino_acid_param.h', needed by
`pdb2txt_relax.o'. Stop.

I'm confused, since header files (*.h) shouldn't need rules because
they're not compiled. What can I do?
[...]


Post to a newsgroup where this is on topic. comp.lang.c++ is about
C++ _language_, not about build tools. Those are usually platform-
specific. Try a UNIX newsgroup, a Linux newsgroup, or gnu.utils[.help]

V
Jul 22 '05 #3
Sorry ! I thought the posting was appropriate to the topic.
Thank you for the tips, anyway.

jose,

Jul 22 '05 #4
"jmborr" <jm****@bu.edu> wrote:
make: *** No rule to make target `amino_acid_param.h', needed by
`pdb2txt_relax.o'. Stop.
...
pdb2txt_relax.o: pdb2txt_relax.cpp amino_acid_param.h \
atom_param.h miscellanea.h random.h
g++ -Wno-deprecated -c pdb2txt_relax.cpp


(This is slightly off-topic for this group, but I just
happen to know the cause and cure for your problem, so
here goes....)

Your make file says "compile amino_acid_param.h as a
source file". Obviously not what you want.

What you need are separate lines to express header
dependencies, withOUT action lines immediately
below them:

pdb2txt_relax.o: amino_acid_param.h atom_param.h
pdb2txt_relax.o: miscellanea.h random.h
pdb2txt_relax.o: pdb2txt_relax.cpp
(TAB) g++ -Wno-deprecated -c pdb2txt_relax.cpp
(TAB) echo pdb2txt_relax has been compiled.

Pay careful attention to the "(TAB)". "Action"
lines must always begin with an actual Tab character
(use your "Tab" key). Dependency lines must NOT
start with a Tab.

Note that you can have many dependency lines for one
target, but only one of these may have "action" lines
immediately under it. The dependency line with the
actions associated should list your source files,
and the dependency lines with NO actions associated
should list your headers. That way, you don't end up
trying to compile headers.

--
Cheers,
Robbie Hatley
Tustin, CA, USA
lo**********@pacbell.net
http://home.pacbell.net/earnur/




Jul 22 '05 #5
Hi Robbie,
I split the dependencies into header ans source files as you
described, but with no success !
It seems the problem comes from the fact that I have the
header files in a different directories than the makefile.
I specified these directories in variable VPATH, but it seems this doesn't
work.
In the GNU-Make manual (pag 21), it says that "make" will search files
located in all directories specified in VPATH , but this is obviously not
working !
Anybody used VPATH before ?

jose,
###### makefile_pdb2txt_relax #####
HOME = /users/seldon/jmborr
CODE = $(HOME)/Code
#VPATH = $(CODE)/Heavy_atom_code:$(CODE)/PDBClasses
VPATH = /users/seldon/jmborr/Code/Heavy_atom_code:$(CODE)/PDBClasses

pdb2txt_relax.x: pdb2txt_relax.o amino_acid_param.o \
atom_param.o miscellanea.o \
bibliography.o pdbClasses2.o
g++ -o pdb2txt_relax.x pdb2txt_relax.o \
amino_acid_param.o atom_param.o \
miscellanea.o bibliography.o pdbClasses2.o

pdb2txt_relax.o: amino_acid_param.h atom_param.h pdb2txt_relax.o:
miscellanea.h random.h
pdb2txt_relax.o: pdb2txt_relax.cpp
g++ -Wno-deprecated -c pdb2txt_relax.cpp
echo pdb2txt_relax has been compiled

include $(CODE)/Heavy_atom_code/makefile_Heavy_atom_code

PHONY : clean

clean :
rm -rf *.o core
######

Jul 22 '05 #6
Hi Robbie,
I split the dependencies into header ans source files as you
described, but with no success !
It seems the problem comes from the fact that I have the
header files in a different directories than the makefile.
I specified these directories in variable VPATH, but it seems this doesn't
work.
In the GNU-Make manual (pag 21), it says that "make" will search files
located in all directories specified in VPATH , but this is obviously not
working !
Anybody used VPATH before ?

jose,
###### makefile_pdb2txt_relax #####
HOME = /users/seldon/jmborr
CODE = $(HOME)/Code
#VPATH = $(CODE)/Heavy_atom_code:$(CODE)/PDBClasses
VPATH = /users/seldon/jmborr/Code/Heavy_atom_code:$(CODE)/PDBClasses

pdb2txt_relax.x: pdb2txt_relax.o amino_acid_param.o \
atom_param.o miscellanea.o \
bibliography.o pdbClasses2.o
g++ -o pdb2txt_relax.x pdb2txt_relax.o \
amino_acid_param.o atom_param.o \
miscellanea.o bibliography.o pdbClasses2.o

pdb2txt_relax.o: amino_acid_param.h atom_param.h pdb2txt_relax.o:
miscellanea.h random.h
pdb2txt_relax.o: pdb2txt_relax.cpp
g++ -Wno-deprecated -c pdb2txt_relax.cpp
echo pdb2txt_relax has been compiled

include $(CODE)/Heavy_atom_code/makefile_Heavy_atom_code

PHONY : clean

clean :
rm -rf *.o core
######

Jul 22 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Huey | last post by:
Hi All, I encountered a funny thing, and my code schetch as below: #define READ 0 #define WRITE 1 int byteRead, status, pd; char buff;
4
by: The Colonel | last post by:
Man, just got a new drive and realized I have to now install THREE versions of Visual Studio (6, 2003 & 2005). Why can I not use the latest version to work with EVERYTHING? You know, "make as...
28
by: Steven Bethard | last post by:
Ok, I finally have a PEP number. Here's the most updated version of the "make" statement PEP. I'll be posting it shortly to python-dev. Thanks again for the previous discussion and suggestions!...
0
by: Steven Bethard | last post by:
Felipe Almeida Lessa wrote: > Em Sex, 2006-04-14 às 09:31 -0600, Steven Bethard escreveu: >> Here's the code I used to test it. >> >> >>> def make(callable, name, args, block_string): >> ... ...
4
by: Eric West | last post by:
First, thanks for taking the time to read this message. I am trying to build a LAMP stack for the first time, and have encountered the following problem: CentOS 4.3 mysql 4.1.20 apache 2.2.3...
4
by: inetquestion | last post by:
php has been configured with the following two configure lines and core's during "make install" on the PEAR section. Is there something simple i'm missing? Any help would be appreciated. ...
2
by: somyav | last post by:
Hi, I need some guidance on how to turn in the java programs as a executable. My requirement is this: I have a package(with .java and .class files) that I am sending it to my clients. They want the...
4
by: jaime | last post by:
Hi again all. Given the line: const int x=5; Can I then use "x" as a constant expression? (By "constant expression", I mean "constant expression" as defined in the C99 standard) I've been...
3
by: jcor | last post by:
Hi, I'm trying the "make distclean" comand. but I allways get this error: if I use the "make clean" I get the same error. Can someone teach me to use this commands, please? Thanks a lot, ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.