Compiling on Linux
Example 1
- Here is a sample makefile for gcc. It compiles sdltest.c file into a binary called sdltest.
all:
gcc `sdl-config --cflags` `sdl-config--libs` -osdltest sdltestExample 2
- This makefile compiles two .c files into a binary called sdltest.
all:
gcc -c `sdl-config --cflags` sdltest1.c sdltest1.o
gcc -c `sdl-config --cflags` sdltest2.c sdltest2.o
gcc `sdl-config--libs` sdltest1.o sdltest2.o -osdltestNote: Makefiles should use tabs instead of spaces unlike here.
