Sign in to follow this  

Makefile question

This topic is 3298 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi. Here's a stripped-down version of the makefile I'm creating:
MYLIST	= demo1 demo2

CXX		= g++
CXXFLAGS	= -pipe
LFLAGS		=
.SUFFIXES: .build

.cpp.build: $<
	$(CXX) $(CXXFLAGS) $(LFLAGS) -o "$*.build" "$<"

mylist: $(MYLIST:=.build)
The rule for mylist should expand to "mylist: demo1.build demo2.build" and trigger the .cpp.build rule. When I run this file I get
make: *** No rule to make target `demo1.build', needed by `mylist'. Stop.
Which I don't understand at all. Funny thing is I had a very similar system in another makefile a while ago and that worked then. I made a couple of minor, seemingly irrelevant changes, and now the old makefile is broken too. What am I doing wrong?

Share this post


Link to post
Share on other sites
Well, the easy answer is: Don't use makefiles. It's old (crappy) technology. I would suggest switching over to a CMake or SCons (Yummy Python) system. Much less hassle, and something that wasn't released in 1977.

Share this post


Link to post
Share on other sites

This topic is 3298 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this