Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
151 user(s) are online (139 user(s) are browsing Forums)

Members: 0
Guests: 151

more...

Support us!

Headlines

 
  Register To Post  

Makefile problems...
Quite a regular
Quite a regular


See User information
Hi everybody,

Perhaps you can help me here.. I'm trying to compile.. something.
Anyway, I'm having a trouble with "No rule to make target ..." errors.

This is a sample makefile I copied from a website so it should be ok!

# makefile for GNU make (automatically generated by makemake)
# NOTE: indent with TAB in GNU makefiles!

# paths are relative to the project directory (current directory during make)

CC gcc
CFLAGS 
= --O2
OBJECTS 
strings.o utils.o

main
.exe : $(OBJECTS)
    $(
CC) $(CFLAGS) $(OBJECTS) -o main.exe

%.: %.c
    
$(CC) $(CFLAGS) -$<


Those are TABs in my file, not spaces, of course.

I've also tried using ".cpp.o :" in place of "%.o : %.c"

It's complaining there's no rule for a .o file but it's clearly there....
Can anybody give any advice?

Thanks!

Go to top
Re: Makefile problems...
Not too shy to talk
Not too shy to talk


See User information
@Spirantho

Do strings.c and utils.c exist in the current directory ?

Bye,
Thomas

Go to top
Re: Makefile problems...
Quite a regular
Quite a regular


See User information
@thomas

Nope. I just noticed that it says "no rule to... " if the file isn't found for some reason. Slightly misleading that!

However, the problem kinda remains because I'm actually using

SRCS = ../common/string.cpp ../amiga/utils.cpp


et al.

Because I'm using make with gcc it's expecting UNIX-like paths... so the files aren't found. Or something.

I could probably get the Makefile to find the file but then GCC wouldn't find them, I reckon.

How do people get round this?

Go to top
Re: Makefile problems...
Just can't stay away
Just can't stay away


See User information
@Spirantho

Quote:
However, the problem kinda remains because I'm actually using

SRCS = ../common/string.cpp ../amiga/utils.cpp


et al.

Because I'm using make with gcc it's expecting UNIX-like paths... so the files aren't found. Or something.

I could probably get the Makefile to find the file but then GCC wouldn't find them, I reckon.

How do people get round this?
By deleting "make" and renaming "gmake" to "make" each time I update it, the version which uses AmigaOS paths is useless.

Go to top
Re: Makefile problems...
Just can't stay away
Just can't stay away


See User information
@joerg

Quote:

By deleting "make" and renaming "gmake" to "make" each time I update it, the version which uses AmigaOS paths is useless.


Or simply learn to type "gmake" when compiling unix programs.

Go to top
Re: Makefile problems...
Quite a regular
Quite a regular


See User information
I get the same error with gmake though.. no rule to target.

This is using UNIXoid pathnames throughout, and this time the files do exist...

Go to top
Re: Makefile problems...
Just can't stay away
Just can't stay away


See User information
@salass00

Quote:
@joerg

Quote:

By deleting "make" and renaming "gmake" to "make" each time I update it, the version which uses AmigaOS paths is useless.


Or simply learn to type "gmake" when compiling unix programs.
Doesn't work for makefiles which start make in subdirectories and don't use $(MAKE) for it.
And it has nothing to do with unix programs at all, none of my AmigaOS programs can be build with the AmigaOS path make either.

Go to top
Re: Makefile problems...
Just can't stay away
Just can't stay away


See User information
@Spirantho

Quote:
I get the same error with gmake though.. no rule to target.

This is using UNIXoid pathnames throughout, and this time the files do exist...
But the sources are not in the same directory as the object files. Either you have to add explicit rules for all files, or try with
VPATH = ../common:../amiga
added to the makefile and using
SRCS = string.cpp utils.cpp

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project