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