LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-25-2005, 05:22 AM   #1
filwhua
LQ Newbie
 
Registered: Jan 2005
Posts: 4

Rep: Reputation: 0
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
 
Old 01-25-2005, 05:57 AM   #2
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
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.
 
Old 01-25-2005, 09:56 PM   #3
filwhua
LQ Newbie
 
Registered: Jan 2005
Posts: 4

Original Poster
Rep: Reputation: 0
thanks, bigearsbilly
 
Old 01-26-2005, 09:35 AM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
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.?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to modify makefile.in or makefile.am QiangWan Linux - Newbie 1 05-17-2005 11:07 AM
how to get (makefile -f makefile )output into the textview widget in Pygtk sailu_mvn Programming 3 02-28-2005 03:57 AM
generate Makefile from Makefile.in without calling ./configure ? chris78 Programming 2 05-02-2004 12:23 PM
Makefile and Zone-file-check michedlp Programming 0 02-18-2004 02:22 PM
Boot disk; check. CD in drive; check. Doesn't work; check. Hal DamnSmallLinux 7 02-04-2004 02:10 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration