# # Sample Makefile # # USAGE: # 1. Replace the a.c b.c with your source files (.c, cpp only) # 2. replace myproj with the name of the executable. # 3. In the first time and every time you add a #include statement # in your program, type "make depend" # 4. To build the program, type make. # LIBS = -lglut -lGL -lGLU -lm CC = gcc CFLAGS = -O -Wall LDFLAGS=-L . SOURCES = SimpleTest.cpp Robot.cpp RobotsBattleGr.cpp OBJECTS := $(patsubst %.cpp,%.o,$(SOURCES)) .cpp.o: $(CC) -c $(CFLAGS) $< all: startbattle startbattle: $(OBJECTS) $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) clean: $(RM) *.o startbattle *~ depend: $(CC) -M $(SOURCES) > .depend -include .depend