Created
March 7, 2013 00:02
-
-
Save ponderomotion/5104375 to your computer and use it in GitHub Desktop.
Generic C++ Makefile for SDL on Mac OSX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHELL = /bin/sh | |
CXX = g++ | |
FFLAGS = -g | |
TARGET = my_executable | |
OBJDIR = obj | |
SRCDIR = src | |
BINDIR = bin | |
VPATH = $(SRCDIR):$(OBJDIR) | |
FULLTARGET = $(BINDIR)/$(TARGET) | |
OBJFILES = SDLMain.o main.o | |
INCLUDES = -I/Library/Frameworks/SDL.framework/Headers/ | |
INCLUDES += -I/Library/Frameworks/SDL_image.framework/Headers/ | |
INCLUDES += -I/Library/Frameworks/SDL_mixer.framework/Headers/ | |
INCLUDES += -I/Library/Frameworks/SDL_ttf.framework/Headers/ | |
LINCLUDES = -framework SDL -framework Cocoa | |
LINCLUDES += -framework SDL_mixer -framework SDL_ttf -framework SDL_image | |
.SUFFIXES: .m .o | |
.m.o: ; @mkdir -p $(BINDIR) $(OBJDIR) | |
$(CXX) -c $(FFLAGS) -o $(OBJDIR)/$@ $< $(INCLUDES) | |
.SUFFIXES: .cpp .o | |
.cpp.o: ; @mkdir -p $(BINDIR) $(OBJDIR) | |
$(CXX) -c $(FFLAGS) -o $(OBJDIR)/$@ $< $(INCLUDES) | |
$(FULLTARGET): $(OBJFILES) | |
$(CXX) $(FFLAGS) -o $@ $(addprefix $(OBJDIR)/, $(OBJFILES)) $(LINCLUDES) | |
.PHONEY: clean | |
clean: | |
@rm -rf *~ $(BINDIR) $(OBJDIR) $(SRCDIR)/*~ *.out | |
%.o: | |
# dependencies | |
main.o: SDLMain.o | |
SDLMain.o: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment