Skip to content

Instantly share code, notes, and snippets.

@robgolding
Created March 15, 2011 20:26
Show Gist options
  • Save robgolding/871391 to your computer and use it in GitHub Desktop.
Save robgolding/871391 to your computer and use it in GitHub Desktop.
A simple Makefile for the G52CFJ coursework
CXX = g++
CXXFLAGS = -g $$(sdl-config --cflags --libs) -lSDL_image -lSDL_ttf
SOURCES = \
BaseEngine.cpp \
BouncingBall.cpp \
BouncingBallMain.cpp \
DisplayableObject.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=game
all: $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CXX) $(CXXFLAGS) -o $@ $(OBJECTS)
clean:
rm -f $(OBJECTS) $(EXECUTABLE)
%.o: %.cpp %.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
run: $(EXECUTABLE)
./$(EXECUTABLE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment