I'm building an SDL2/C++ program that needs to be portable to Windows, Mac, and Linux machines which may not have SDL installed.

I've read that static linking is the solution, but I'm not very good with compiling and don't know how to static link.

My program relies only on SDL2, GLU, and OpenGL. I'm compiling C++ with either MinGW (on Windows 8.1) or gcc (on Ubuntu 14.04) -- both of these OS's have SDL installed natively.

Here is my current makefile, derived from a sample makefile given to me by a professor of mine:

```
# Executable/file name
EXE=experiment

#  MinGW
ifeq "$(OS)" "Windows_NT"
CFLG=-O3 -Wall -DUSEGLEW
LIBS= -lSDL2 -lglu32 -lopengl32
CLEAN=del *.exe *.o *.a
else
#  OSX
ifeq "$(shell uname)" "Darwin"
CFLG=-O3 -Wall -Wno-deprecated-declarations
LIBS=-framework SDL2 -framework OpenGL
#  Linux\Unix\Solaris
else
CFLG=-O3 -Wall
LIBS= `sdl2-config --cflags --libs` -lGLU -lGL -lm
endif
#  OSX\Linux\Unix\Solaris
CLEAN=rm -f $(EXE) *.o *.a
endif

# Dependencies
$(EXE).o: $(EXE).cpp FORCE

.c.o:
    gcc -c -o $@ $(CFLG) $<
.cpp.o:
    g++ -std=c++11 -c -o $@ $(CFLG) $<

#  Link
$(EXE):$(EXE).o
    g++ -std=c++11 -O3 -o $@ $^   $(LIBS)

#  Clean
clean:
    $(CLEAN)

# Force
FORCE:

```