LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   please check out my makefile (https://www.linuxquestions.org/questions/programming-9/please-check-out-my-makefile-281962/)

filwhua 01-25-2005 05:22 AM

please check out my makefile
 
Code:

CPP = g++
OFLAG = -o
.SUFFIXES = .cpp .o
.cpp.o:
  $(CPP) -c $<

all: \
    example

example: example.o
  $(CPP) $(OFLAG) example example.o
 
example.o: example.cpp

Why always report "makefile:5: *** missing separator. Stop."?

thanks in advance

bigearsbilly 01-25-2005 05:57 AM

REMEMBER:

for the rules, the first character needs to be a <TAB>

target:
<TAB>rule

do a cat -vt makefile to make tabs visible as a ^I and you should see
something like:
Code:

target:
^I rule

You do know that make has all the built-in rules you need
for compiling most languages?

So you don't need to re-state these rules.

In fact, for really simple progs you don't even need a makefile.
If you gzip your make file then type make example
it should do what you want.

filwhua 01-25-2005 09:56 PM

thanks, bigearsbilly

Matir 01-26-2005 09:35 AM

Quote:

Originally posted by bigearsbilly

You do know that make has all the built-in rules you need
for compiling most languages?

So you don't need to re-state these rules.

In fact, for really simple progs you don't even need a makefile.
If you gzip your make file then type make example
it should do what you want.

Which rules are built in? And what's this with the gzipping, etc.?


All times are GMT -5. The time now is 11:12 AM.