LinuxQuestions.org
Help answer threads with 0 replies.
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 04-07-2009, 06:52 AM   #1
Zmyrgel
Senior Member
 
Registered: Dec 2005
Location: Finland
Distribution: Slackware, CentOS, RHEL, OpenBSD
Posts: 1,006

Rep: Reputation: 37
Makefile not working


I'm trying to make a Makefile but currently I get error "No target for 'bell.o' needed by all" when I run this but to me it seems that there is a target for it.
Could somebody shed some light into this.

Code:
CC=g++
OBJS='bell.o building.o button.o clock.o door.o elevatorButton.o elevator.o ElevatorSimulation.o floorButton.o floor.\
o light.o person.o scheduler.o'
APP=hissi
 
all: $(OBJS)
         $(CC) $(OBJS) -o $(APP)
 
bell.o: bell.cpp bell.h
        $(CC) -c bell.cpp
 
building.o: building.cpp building.h elevator.h elevatorButton.h button.h \
  door.h bell.h floor.h floorButton.h light.h clock.h scheduler.h
        $(CC) -c building.cpp
 
button.o: button.cpp button.h
        $(CC) -c button.cpp
 
clock.o: clock.cpp clock.h
        $(CC) -c clock.cpp
 
door.o: door.cpp door.h person.h floor.h floorButton.h button.h light.h \
  elevator.h elevatorButton.h bell.h
        $(CC) -c door.cpp
 
elevatorButton.o: elevatorButton.cpp elevatorButton.h button.h elevator.h \
  door.h bell.h
        $(CC) -c elevatorButton.cpp
 
elevator.o: elevator.cpp elevator.h elevatorButton.h button.h door.h \
  bell.h person.h floor.h floorButton.h light.h
        $(CC) -c elevator.cpp
 
ElevatorSimulation.o: ElevatorSimulation.cpp building.h elevator.h \
  elevatorButton.h button.h door.h bell.h floor.h floorButton.h light.h \
  clock.h scheduler.h
        $(CC) -c ElevatorSimulation.cpp
 
floorButton.o: floorButton.cpp floorButton.h button.h elevator.h \
  elevatorButton.h door.h bell.h
        $(CC) -c floorButton.cpp
 
floor.o: floor.cpp floor.h floorButton.h button.h light.h person.h \
  elevator.h elevatorButton.h door.h bell.h
        $(CC) -c floor.cpp
 
light.o: light.cpp light.h
        $(CC) -c  light.cpp
 
person.o: person.cpp person.h floor.h floorButton.h button.h light.h \
  elevator.h elevatorButton.h door.h bell.h
        $(CC) -c person.cpp
 
scheduler.o: scheduler.cpp scheduler.h floor.h floorButton.h button.h \
  light.h person.h
        $(CC) -c scheduler.cpp
clean:
	rm -rf *o $(APP) *.core
 
Old 04-07-2009, 08:18 AM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Remove the single quotes from the list of object files:
Code:
OBJS=bell.o building.o button.o clock.o door.o elevatorButton.o elevator.o ElevatorSimulation.o floorButton.o floor.\
o light.o person.o scheduler.o
--- rod.
 
Old 04-07-2009, 08:23 AM   #3
Zmyrgel
Senior Member
 
Registered: Dec 2005
Location: Finland
Distribution: Slackware, CentOS, RHEL, OpenBSD
Posts: 1,006

Original Poster
Rep: Reputation: 37
Quote:
Originally Posted by theNbomr View Post
Remove the single quotes from the list of object files:
Code:
OBJS=bell.o building.o button.o clock.o door.o elevatorButton.o elevator.o ElevatorSimulation.o floorButton.o floor.\
o light.o person.o scheduler.o
--- rod.
Thanks, its working now.
 
  


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
Is it mandatory to have the name of the makefile as 'Makefile' for kernal module comp narender.d Linux - Kernel 3 05-29-2009 06:26 AM
Makefile ifeq not working 91change Linux - Newbie 2 11-20-2008 11:34 PM
how to get (makefile -f makefile )output into the textview widget in Pygtk sailu_mvn Programming 3 02-28-2005 03:57 AM
Problem generating a working makefile from configure: MadCactus Linux - Software 0 08-20-2004 08:51 AM
generate Makefile from Makefile.in without calling ./configure ? chris78 Programming 2 05-02-2004 12:23 PM

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

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

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