Last active
August 29, 2015 14:05
-
-
Save fredmorcos/0728031217533079cc90 to your computer and use it in GitHub Desktop.
Makefile for building an X-less SDL2 program on the Raspberry Pi
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
CFLAGS += -Wall -Wextra -pedantic -std=c11 -g `sdl2-config --cflags` | |
LDFLAGS += `sdl2-config --libs` | |
.PHONY: clean run | |
%.o: %.c | |
$(CC) -I/opt/vc/include $(CFLAGS) -c $< -o $@ | |
prog: main.o | |
$(CC) -L/opt/vc/lib $(LDFLAGS) $^ -o $@ | |
run: prog | |
SDL_VIDEO_GL_DRIVER=/opt/vc/lib/libGLESv2.so ./prog | |
clean: | |
rm -f prog *.o |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment