mardi 21 janvier 2020

Makefile c++11 unix errors

I am trying to compile a project on a unix server with a makefile.

This is the makefile I am using :

G = g++
DEBUG = -DNDEBUG -g
FLAGS = -std=c++11 -Wall -Werror -pedantic-errors
UA_OBJS = UniqueArray.o UniqueArrayTest.o
PARKING_LOT_OBJS = UniqueArray.o MtmParkingLot.o ParkingLot.o ParkingLotPrinter.o ParkingSpot.o Time.o Vehicle.o UniqueArray.h UniqueArrayImp.h

#Create ParkingLot

MtmParkingLot : $(PARKING_LOT_OBJS)
    $(G) $(DEBUG) $(PARKING_LOT_OBJS) $(FLAGS) -o MtmParkingLot *.cpp
MtmParkingLot.o : ParkingLotTypes.h Time.h ParkingLotPrinter.h ParkingLot.h Time.cpp ParkingLotPrinter.cpp Parking.cpp
    $(G) $(DEBUG) $(FLAGS) -c MtmParkingLot.cpp
ParkingLot.o : ParkingLot.h ParkingLot.cpp Vehicle.h Vehicle.cpp UniqueArrayImp.h Time.h Time.cpp ParkingLotTypes.h ParkingLotPrinter.h ParkingLotPrinter.cpp ParkingSpot.h ParkingSpot.cpp
    $(G) $(DEBUG) $(FLAGS) -c ParkingLot.cpp
ParkingLotPrinter.o : ParkingLotPrinter.h ParkingLotPrinter.cpp
    $(G) $(DEBUG) $(FLAGS) -c ParkingLotPrinter.cpp
ParkingSpot.o : ParkingSpot.h ParkingSpot.cpp
    $(G) $(DEBUG) $(FLAGS) -c ParkingSpot.cpp
Time.o : Time.h Time.cpp
    $(G) $(DEBUG) $(FLAGS) -c Time.cpp
Vehicle.o : Vehicle.h Vehicle.cpp
    $(G) $(DEBUG) $(FLAGS) -c Vehicle.cpp

#Create UniqueArray

UniqueArrayTest : $(UA_OBJS)
    $(G) $(DEBUG) $(FLAGS) -o UniqueArrayTest.cpp
UniqueArray.o : UniqueArray.h UniqueArrayImp.h UniqueArrayTest.cpp
    $(G) $(DEBUG) $(FLAGS) -c UniqueArrayTest.cpp
UniqueArrayTest.o : UniqueArray.h UniqueArrayImp.h UniqueArrayTest.cpp
    $(G) $(DEBUG) $(FLAGS) -c UniqueArrayTest.cpp

clean : 
    rm -f $(PARKING_LOT_OBJS) $(UA_OBJS) MtmParkingLot UniqueArray

Typing make clean results this message : make: *** No rule to make target `clean'. Stop.

Typing 'make UniqueArrayTest` results this message : make: Nothing to be done for "UniqueArrayTest".

As for make MtmParkingLot this is the message : make: `MtmParkingLot' is up to date. Which generally is not an error but I have the compiled file for MtmParkingLot from before I tried to compile with this makefile so I'm not sure this rule is correct either.

Aucun commentaire:

Enregistrer un commentaire